Commit Graph

1009 Commits

Author SHA1 Message Date
Lachlan 9e0cd71b31
Merge pull request #10391 from eclipse/jetty-12.0.x-10385-GzipDefaultServletTest
Issue #10385 - fix NPE in GzipDefaultServletTest
2023-08-25 15:46:24 +10:00
Simone Bordet 4c32dfc4d8
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-24 18:56:21 +02:00
Lachlan Roberts 9ed8050183 Issue #10385 - fix NPE in GzipDefaultServletTest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-24 17:42:01 +10:00
Simone Bordet 9d908839cf Fixes #10338 - ErorrHandler#writeErrorJson is private
Made the writeErrorXYZ() methods protected in ErrorHandler for core, ee9 and ee10.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-23 18:03:13 +02:00
Simone Bordet 7f1d262aee
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-23 15:47:15 +02:00
Ludovic Orban 1fff9787bd #10226 - handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-22 10:17:33 +02:00
Ludovic Orban 6b1c490dbc #10330 - simplify acceptRanges setting's handling logic
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-22 10:17:33 +02:00
Ludovic Orban 7f0a356585 #10330 - Fix broken EE9 DefaultServlet range requests
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-22 10:17:33 +02:00
Olivier Lamy 97e1527ed6
Jetty 12.0.x use Maven build cache for PRs and branches except jetty-12.0.x main branch (#9871)
* apply configuration/changes for build cache

Signed-off-by: Olivier Lamy <olamy@apache.org>

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-08-22 02:46:46 +02:00
Simone Bordet 486ec677cf
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-21 10:43:49 +02:00
Simone Bordet 660ba4bbe5
Fixes #10284 - Document all HttpFields methods (#10308)
* Added javadocs where missing and updated existing in both HttpFields and HttpField.
* Removed HttpFields.takeAsImmutable() because it had a confusing semantic.
* Deprecated HttpFields.[Mutable|Immutable]HttpFields and moved their implementation to top level package private classes.
* Deprecated HttpField.valueParameters(), as there is an identical getValueParameters()
* Fixed inconsistencies of HttpField.value, where in most cases could not be null, but in one case was allowed; now it can never be null.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-18 10:19:36 +02:00
Jan Bartel fe1831008a
Issue #10323 Fix ee10 Request.isRequestedSessionIdValid (#10331)
* Issue #10323 Fix ee10 Request.isRequestedSessionIdValid
2023-08-18 03:19:53 +02:00
Jan Bartel 5160ad29ef
Issue #10207 Update missing JSP message. (#10320)
* Issue #10207 Update missing JSP message.
2023-08-18 03:19:06 +02:00
Greg Wilkins 042841a7c6
Fix #10306 getServerHost (#10311)
Fix #10306 getServerHost
2023-08-18 10:11:39 +10:00
Simone Bordet cab3128d53
Fixed POM dependency.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-17 17:15:52 +02:00
Simone Bordet 4c9679c5b3
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-17 17:14:59 +02:00
Greg Wilkins 5aea1e44b7
Experiment/12/improve default servlet (#10222)
* Improve Jetty 12 DefaultServlet

 + don't wrap the httpServletRequest unless necessary due to wrapping
 + don't wrap the httpServletResponse unless necessary due to wrapping
 + send content asynchronously if large and unfiltered
 + Remove unused boolean return from ServletChannel.handle
 + added TODOs where range request handling could calculate content length
 + Call multipartlength, even though it is always -1
 + Use static for bytes written
2023-08-18 00:54:05 +10:00
Greg Wilkins cdf5035ab2
Various Cleanup in ServletChannel (#10064)
remove lambdas for clarity
 TODO Non-blocking error dispatch
 TODO isHandled does not exist
 TODO checkAndPrepareUpgrade and implement servlet upgrade?
 remove unused variables
 review javadoc (including any warnings)
 review any compiler or findbug warnings (if any)

---------

Signed-off-by: gregw <gregw@webtide.com>
2023-08-15 20:02:25 +10:00
Greg Wilkins 16b00e2a13
Allow better configuration of WebAppContext classloader (#10163)
* Allow better configuration of WebAppContext classloader

Moved the creation of a WebAppContext classloader into an extensible method.

* Allow better configuration of WebAppContext classloader

EE8/9 also

* Allow better configuration of WebAppContext classloader

Only close loader if context created it.
2023-08-11 11:24:46 +10:00
Joakim Erdfelt 9c324326c5
Merge `release/12.0.0` back into `jetty-12.0.x` (#10237)
* Updating to version 12.0.0

* Updating to version 12.0.1-SNAPSHOT
2023-08-08 00:55:19 +02:00
Lachlan Roberts 466b75cec2 fix websocket demo for ee8 jetty-12
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-07 11:17:39 +10:00
Lachlan Roberts 1d52c83ae2 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-websocket-demos 2023-08-07 11:11:58 +10:00
Greg Wilkins 70a7a6769c
Fix #10229 servlet Idle Timeout (#10233)
* Fix #10229  Idle Timeout

Added test to reproduce

Fixed NPE if no failure listener


Possible

Added test that idle works between requests

EE9 idle timeout

idle if read operation

Handle idleTimeout for IO operations differently

improve comments

fixed test to not expect timeout listener to be called if there is demand

Idle timeouts for IO operations are not last.

Disable transient idle timeouts since AsyncContentProducer cannot handle them.

revert test to persistent idle failures
2023-08-07 06:05:05 +10:00
Joakim Erdfelt 5535179134
Issue #10231 - ee10 `DefaultServlet` HTTP method support. (#10232)
* Issue #10231 - ee10 & ee9 DefaultServlet HTTP method support.

+ HEAD support & testing
+ TRACE disabled & testing
+ OPTIONS support & testing
+ POST disabled & testing
2023-08-05 10:50:24 -05:00
Lachlan Roberts e3bbb0f718 fix websocket demo for ee8 jetty-12
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-01 11:48:09 +10:00
Lachlan Roberts a1e88f78a5 fix websocket demo for ee8 jetty-12
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-01 11:32:24 +10:00
Lachlan 55e107447b
Merge pull request #10165 from eclipse/jetty-12.0.x-javaxSourceRename
rename JAVAX_API to JAKARTA_API in ee9 and ee10 Source
2023-08-01 11:22:44 +10:00
Joakim Erdfelt b9c39b1105
Ensure @BeforeEach and @AfterEach are public 2023-07-31 11:53:15 -05:00
Joakim Erdfelt ce06628f2e
Ensure WorkDir field is public 2023-07-31 11:44:11 -05:00
Joakim Erdfelt b6af685cd0
Ensure @Test methods are public 2023-07-31 11:42:33 -05:00
Simone Bordet e030aeefa6
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-31 17:01:49 +02:00
Lachlan bd7d504c28
Issue #10135 - fix empty binary frame from websocket flush (#10175)
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-07-31 15:21:12 +02:00
Lachlan Roberts 627f9f7321 fix additional javax references from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-07-31 12:15:41 +10:00
Lachlan Roberts 4e9c59cb78 rename JAVAX_API to JAKARTA_API in ee9 and ee10 Source
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-07-28 15:14:05 +10:00
Ludovic Orban 4a8b517e58
Add extra DefaultServlet include tests (#10154)
#10142 Added extra DefaultServlet include tests

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: gregw <gregw@webtide.com>
2023-07-26 23:36:31 +02:00
Joakim Erdfelt 453526845d
Issue #10141 and #10142 - Reintroduce context init-param `org.eclipse.jetty.servlet.Default.` prefix for ee10 (#10149)
+ Issue #10141 and #10142 - Reintroduce context init-param `org.eclipse.jetty.servlet.Default.` prefix for ee10
+ Fix named servlet lookup NPE in ee10 ServletHandler.getMappedServlet
+ Adding requested javadoc
2023-07-26 06:35:54 -05:00
Simone Bordet c19a5817f9
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-17 23:51:40 +02:00
Simone Bordet 0ef1845da6
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-17 11:08:25 +02:00
Simone Bordet 69e2f10521
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-16 12:01:43 +02:00
Joakim Erdfelt 8e52abe8c9
Merge `jetty-11.0.x` into `jetty-12.0.x` - July 14 (#10108)
* Updating various old/moved URL references found across project (`jetty-10.0.x`) (#10098)

+ Now that the migration of `https://eclipse.org/jetty/` to `https://eclipse.dev/jetty/` has occurred, it is time to review the URI use in our project
+ Updated URLs in poms
+ Added more URIs to XmlConfiguration
+ Updated URLs in module files
+ Updated URLs in documentation
+ Updated URLs in HTML
+ Correcting bad double-scheme URLs (eg: `http://https://www.eclipse...`)
+ Updating text in *.mod files
+ Removing `/current/` from path `/jetty/documentation/current/`
+ Fixing mailing list URL
+ Fixing github URL references in jsps

---------

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-07-14 20:21:11 -05:00
Simone Bordet 0879f6bc85
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-14 17:49:07 +02:00
Lachlan Roberts 887528e575 increase timeouts in AsyncServletTest to make it less flaky
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-07-14 11:27:35 +10:00
Greg Wilkins 0ee0716d33
Various cleanups of StringUtil and TypeUtil (#10082)
* Various cleanups of StringUtil and TypeUtil

Removed deprecated and unused methods
Moved charset handling to MimeTypes
resolve IDE warnings

* updates from review
2023-07-12 10:31:28 +02:00
Joakim Erdfelt c8fd1a198a
Issue #10084 - Directory results from `getResourcePaths(String)` should include trailing slash (#10085)
* Issue #10084 - Directory entries on return of getResourcePaths(String) should include trailing slash
* Issue #10084 - Fixing test case order of entries in collection expectation
* Issue #10084 - Implementing fix for ee9
* Issue #10084 - Fixing bug in ServletContext.getRealPath() impl
* Issue #10084 - Fixing tests in ee9 to make them compatible with ee8 conversion
* Bring Resource.getFileName in alignment with other JVM methods of the same name. (eg: Path.getFileName)
2023-07-11 11:39:23 -05:00
Jan Bartel 0c5b07b0ae
Issue #10068 allow Resource configuration in jetty maven plugin (#10077) 2023-07-07 09:55:18 +02:00
Greg Wilkins ba664769f3
Fix/jetty 12 code ql cleanups (#10078)
Exact long to int conversion.
2023-07-07 09:17:39 +02:00
Jan Bartel 3e75b4fb1c Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-07-05 23:59:27 +02:00
gregw e0133d72bf Merge branch 'jetty-12.0.x' into jetty-12.0.x-9396-websocket-jpms-review 2023-06-30 17:17:16 +02:00
Joakim Erdfelt 6b95a929bd
Merge remote-tracking branch 'origin/jetty-11.0.x' into fix/12.0.x/merge-11.0.x 2023-06-30 06:56:03 -05:00
Lachlan c43514f4f5
Merge pull request #9878 from eclipse/jetty-12.0.x-ee9-ContextHandlerClassLoading
Fixes and extra testing for EE9 ContextHandler class loading
2023-06-30 15:46:05 +10:00
Lachlan Roberts e1b0d01aa0 changes to websocket poms and module-info from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-30 14:26:02 +10:00
Jan Bartel d3d298c5f3 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-06-29 15:01:19 +02:00
Jan Bartel 5dee316da3 Merge remote-tracking branch 'jetty-11/jetty-11.0.x' into jetty-12.0.x 2023-06-29 12:55:35 +02:00
Lachlan Roberts e2ca582e10 fix .mod files and tests for websocket client
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-28 11:12:56 +10:00
Lachlan Roberts 6ba4670fb9 split a webapp module for jetty-ee9-websocket-jetty-client
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-27 18:07:59 +10:00
Lachlan Roberts e2cc47b0f8 split a webapp module for jetty-ee9-websocket-jakarta-client
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-27 16:17:44 +10:00
Lachlan Roberts 8b0e28f7b5 update javadoc for nested ContextHandler
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-27 13:07:02 +10:00
Lachlan Roberts 6dd5fd7225 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-ee9-ContextHandlerClassLoading 2023-06-26 12:38:49 +10:00
Lachlan Roberts 2030afea62 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-WebSocketDemand 2023-06-26 12:12:56 +10:00
Ludovic Orban 8f4a15c7da
#9946 Stop passing Handler in constructor as a parent (#9948)
#9946 Stop passing Handler in constructor as a parent

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-23 14:44:12 +02:00
gregw 875740fde7 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
# Conflicts:
#	jetty-ee9/jetty-ee9-proxy/src/test/java/org/eclipse/jetty/ee9/proxy/AbstractProxyServletTest.java
2023-06-23 09:24:43 +02:00
Greg Wilkins a3e82326cf
Experiment/jetty 12 chunk isError and warnings (#9904)
* Remove usage of instanceof Content.Chunk.Error
* Updated AsyncContent to accept a transient failures
* Updated AsyncContent to accept a transient failure with inputstream
2023-06-23 09:17:15 +02:00
Greg Wilkins 0b1c28a888
Jetty 12 inserted handler in ee10 servlet context (#9927)
This PR refactors the ee10 handing of servlet API request and response objects:

 + The ServletContextHandler matches the request to a servlet and creates a one time only ServletContextRequest and a ServletContextResponse
 + A reusable ServletChannel object with all the heavy weight HttpInput and HttpOutput object is associated with the ServletContextRequest and ServletContextResponse.
 + Once the handling reaches the ServletHandler, the possibly wrapped request, response and callback are associated with the ServletChannel before handling.
 + Were possible the ServletApiRequest and ServletApiResponse use the possibly wrapped request/response

Added tests to check that GzipHandler can now be nested inside of an EE10 context.

---------

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: gregw <gregw@webtide.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-06-22 17:04:49 +02:00
Lachlan Roberts d5c81f9f93 fix checkstyle error
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-22 21:07:09 +10:00
Lachlan Roberts 0ffeb87817 use fields in nested Request instead of attributes for last context
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-22 20:56:14 +10:00
Lachlan Roberts 9e99a58ac4 Issue #9944 - remove integer from demand in websocket core
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-22 09:08:29 +10:00
Lachlan Roberts 44de5cd62b fix NPE from Response.checkSameSite()
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-22 07:49:24 +10:00
Lachlan Roberts 57a863088b save some attributes for request log and error dispatch
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-21 17:06:18 +10:00
Lachlan Roberts 8550493c31 decode Path in content for nested Request
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-21 14:58:09 +10:00
gregw c813852385 Fix tests for JPMS 2023-06-20 16:09:13 +02:00
Lachlan Roberts bf5e0e94f8 Maintain context path in original nested Requests pathInContext
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-20 20:52:43 +10:00
Lachlan Roberts 0dce49c9bf Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-ee9-ContextHandlerClassLoading 2023-06-20 19:44:32 +10:00
Olivier Lamy 87eb651c1f
mark CloseableDoSFilterTest#testEvenLowRateIP as flaky tests (#9930)
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-06-20 13:52:26 +10:00
Steffen Nießing 5d87ea7254
Fix spotbugs packages (#9929)
* Fix spotbugs packages

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* remove jdk17 profile which disable spotbugs

---------

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>
Co-authored-by: Olivier Lamy <olamy@apache.org>
2023-06-20 10:54:16 +10:00
Lachlan Roberts cf78881f04 Issue #9396 - Improve JPMS testing for websocket in Jetty 12
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-19 14:34:40 +10:00
Lachlan 2a683e7774
Merge pull request #9916 from eclipse/jetty-12.0.x-PR9903-Merge
Merge PR #9903 to Jetty-12 (PerMessageDeflateExtension callback completion)
2023-06-16 14:23:22 +10:00
Greg Wilkins 926a15aa62
fixing JPMS and reactivating the tests (#9911)
* WIP fixing JPMS and reactivating the tests

* fix jndi demos with jpms activated

Signed-off-by: Olivier Lamy <olamy@apache.org>

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Olivier Lamy <olamy@apache.org>
2023-06-16 12:52:11 +10:00
Lachlan Roberts 5d4fa756a0 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-06-16 08:11:28 +10:00
Lachlan Roberts 5dcf022d66 use Request.setContext in all places done in Jetty-11
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-16 07:39:48 +10:00
Lachlan 58cee22ba4
Merge pull request #9908 from eclipse/jetty-12.0.x-PR9891
Merge PR #9891 to Jetty-12
2023-06-16 07:24:38 +10:00
Ludovic Orban 8e79c1b58b
Add `EventsHandler` API (#9901)
* #8885 add EventsHandler API

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-15 17:31:11 +02:00
Jan Bartel 9e4dc46a3e
Pause before checking session eviction (#9893)
* Pause before checking session eviction

* Change after review
2023-06-15 14:26:18 +02:00
Jan Bartel 69964468bb
Issue #9906 Empty path info (#9907)
* Issue #9906 Empty path info

* Update jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/ServletContextHandlerTest.java

Co-authored-by: Olivier Lamy <oliver.lamy@gmail.com>

* Update jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/ServletContextHandlerTest.java

Co-authored-by: Olivier Lamy <oliver.lamy@gmail.com>

---------

Co-authored-by: Olivier Lamy <oliver.lamy@gmail.com>
2023-06-15 12:13:21 +02:00
Lachlan Roberts 48367f3baf Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-06-15 13:56:28 +10:00
Lachlan Roberts e4c79c551c Scope the request to the current ContextHandlers ApiContext
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-15 11:18:05 +10:00
Lachlan Roberts d00391e86e Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-ee9-ContextHandlerClassLoading 2023-06-15 10:20:17 +10:00
Jan Bartel 4e316dbf62
Jetty 12.0.x ee9 serverpush tck (#9902)
* Make a test case to resemble a failing tck test

* Add more test cases more like the tck test

* Fixed processing of EOF frames for pushed requests.

Before, the EOF frame was not added to the HTTP2Stream queue.
When the pushed request was completing it tried to consume the available content, but it was not finding EOF and so was emitting a reset frame, causing the TCK failure.

Now the EOF frame is always added to the HTTP2Stream queue, so it is properly consumed when completing the pushed request.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>

* Fix H2 trailers frames

Signed-off-by: Ludovic Orban <lorban@bitronix.be>

---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-06-14 14:22:45 +02:00
Greg Wilkins 963d33111e
Jetty 12 idletimeout (#9905)
* IdleTimeout review

 + pass TimeoutException through all APIs
 + HttpConnection now passes on TimeoutException to HttpChannel.onFailure
* More ServerTests for idletimeout

* Recreated a ServerTimeoutsTest for multiple transports

* more robust tests

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>

* merged work from @sbordet and @gregw

* Various improvements to CyclicTimeouts.
* Improved reset of the earliest timeout before iteration.
* Removed check for getExpireNanoTime() == -1, since it's a valid value.
* When onExpired(Expirable) returns false, the Expirable should arrange to move its timeout in the future.

* fix keystore to please BoringSSL + use correct temp path

Signed-off-by: Ludovic Orban <lorban@bitronix.be>

* Fixed ErrorResponseAndCallback succeeded() and failed() to call super.failed() in all cases to complete the wrapped callback.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>

* Revert "Fixed ErrorResponseAndCallback succeeded() and failed() to call super.failed() in all cases to complete the wrapped callback."

This reverts commit 5ac57c13e0.

* WIP idleTimeout

* WIP idleTimeout

* Added context wrapper for idle timeout listener

* updates from review

---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-06-14 09:57:10 +02:00
Lachlan Roberts 4c1cf7de64 PR #9878 - fixes for test failures
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-14 11:41:24 +10:00
Lachlan Roberts a67e48d1ee Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-ee9-ContextHandlerClassLoading 2023-06-14 10:31:51 +10:00
Greg Wilkins d3e88a95fe
Jetty 12.0.x custom request log #8819 (#9896)
* Resolve #8819 CustomRequestLog improvement

Resolves #8819 CustomRequestLog improvements:
 + only add extra detail if the log is a CustomRequestLog
 + add extra detail as a record
 + get authentication state directly from request attribute

* protect against null core request

* protect against null core request

* Use nanotime for logged latency
2023-06-13 11:12:45 +02:00
Lachlan Roberts f3b925a893 PR #9878 - changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-09 14:10:43 +10:00
Olivier Lamy a617784e8e
Remove duplicated classes from test session, fix some to be able to run in parallel and not restarting 3rd party for each tests (#9782)
---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-06-09 06:47:36 +10:00
Jan Bartel 1bc1aacbe7
Fix redirect demo; fix links to sources for demos; fix blog link (#9890)
* Fix redirect demo; fix links to sources for demos; fix blog link

* Update jetty-home/src/main/resources/modules/demo.d/root/index.html

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

---------

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-06-08 18:24:08 +02:00
Jan Bartel 4ec7dc73f6
Jetty 12.0.x 9072 move core ee classes (#9883)
* Issue #9072 refactor jetty-ee module to remove it

* Remove old ee imports in module-info.javas

* Remove jetty-ee from deps

* Fix references to jetty-ee for osgi

* Update jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/Deployable.java

Co-authored-by: Greg Wilkins <gregw@webtide.com>

---------

Co-authored-by: Greg Wilkins <gregw@webtide.com>
2023-06-08 18:22:57 +02:00
Jan Bartel c13c869e3d
Jetty 12.0.x 9760 fix cookie parsing (#9894)
* Add test to show failure

* Fix #9760 EE9 Cookies

Fix #9760 Only set path and domain if they are not blank

* Fix #9760 EE9 Cookies

Fix #9760 Only set path and domain if they are not blank
Switch on violation rather than type

* Handle legacy cookie version and comment

* Handle cookie version and comment

---------

Co-authored-by: gregw <gregw@webtide.com>
2023-06-08 18:20:39 +02:00
Greg Wilkins c0de62b2c6
Jetty 12 graceful contexts (#9867)
Removed all shutdown mechanisms from ContextHandler
Fixed GracefulHandler

---------

Signed-off-by: gregw <gregw@webtide.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-06-07 21:05:49 +02:00
Jan Bartel 18a0738923
Issue #9879 re-enable and fix rewrite demo (#9882) 2023-06-07 19:13:44 +02:00
Lachlan Roberts 7eebfc1955 fixes for ContextHandler lifecycle when called directly
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-07 13:24:31 +10:00
Jan Bartel 6b362c03a9
Issue #9657 (#9781) 2023-06-06 11:06:48 +02:00
Lachlan Roberts c96fdd728a cleanup unused variables in nested ContextHandler
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-06 15:29:38 +10:00
Lachlan Roberts 3fd9ac2875 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-ee9-ContextHandlerClassLoading 2023-06-06 15:21:45 +10:00
Lachlan Roberts 24cb5dba4a Add test to reproduce classloader failures in 12.0.x.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-06 15:21:31 +10:00
Lachlan Roberts f225fb0138 Fix EE9 ContextHandler class loading when it is not the root handler.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-06 14:52:52 +10:00
Ludovic Orban c1f1a6018b Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-06-05 17:31:13 +02:00
Simone Bordet 22641f1267
Fix/jetty 12 restore ee n fcgi (#9796)
* Restored ee9 FastCGIProxyServlet and TryFilesFilter.
* Restored ee10 FastCGIProxyServlet and TryFilesFilter.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-06-05 16:50:11 +02:00
Greg Wilkins 1c01a49149
Jetty 12 context initial ClassLoader (#9866)
* Ensure environment classloader in ContextHandler
* Set the initial classloader in ContextHandler
* WebAppContext uses initial classloader
2023-06-05 16:49:15 +02:00
Simone Bordet 8c4e75bf8d
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-28 00:34:49 +02:00
Lachlan Roberts 152030de09 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-05-22 18:05:21 +10:00
Jan Bartel 5c2e7afcef
Issue #9785 context path set incorrectly for ee9 (#9786) 2023-05-22 09:35:47 +02:00
gregw d2b71d7968 Fix tests broken by #9774
Cross context is not support
2023-05-19 09:25:13 +02:00
Jan Bartel f6822a2162
Issue #9774 Disallow cross context (#9775)
* Issue #9774 Disallow cross context
2023-05-18 15:11:50 +02:00
Greg Wilkins 068a60a868
Simplified QuotedStringTokenizer (#9729)
Simplified QuotedStringTokenizer #9729
* Now implements a simple subset of `quoted-string` from RFC9110
* introduced builder
* Extracted QuotedStringTokenizer interface and re-introduced the legacy implementation
* Re-introduced the ability to have unescaped \ in filenames
* Whitespace is Character.isWhiteSpace
* Disable test pending RFC8187
* No OWS around =
2023-05-18 08:25:53 +02:00
gregw 3e5d479f39 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
# Conflicts:
#	jetty-ee9/jetty-ee9-servlets/src/test/java/org/eclipse/jetty/ee9/servlets/CrossOriginFilterTest.java
2023-05-18 00:18:45 +02:00
Simone Bordet e52e95f788
Fixes #9766 - jetty-12 ee9 ServerPush failures. (#9776)
* Restored dispatch=true for pushed requests.
* Restored tests that use the Servlet APIs to push.
* Ensured that pushed streams have request content EOF.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-17 15:42:05 +02:00
Ludovic Orban ac2765c98d Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-05-15 10:09:36 +02:00
Jan Bartel 2261ce9a50
Issue #9762 ee9 double parses cookies (#9764)
* Issue #9762 ee9 double parses cookies

* implemented the TODOs to cache servlet cookies

---------

Co-authored-by: gregw <gregw@webtide.com>
2023-05-12 17:14:44 +02:00
Ludovic Orban 143509c214 #9639 fix typo in null check resulting in invalid warnings being emitted
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-05-10 15:51:31 +02:00
Lachlan Roberts b0f292b4ca cleanups of old jaspi dependencies
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-05-09 15:11:53 +10:00
Lachlan Roberts 99a673b900 minor change to jaspi poms
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-05-09 14:57:22 +10:00
Jan Bartel 626ab7a964
Issue #9743 changeSessionId should throw ISE if no session (#9744) 2023-05-08 23:25:57 +10:00
Greg Wilkins 4c16e6a707
Jetty 12 content length 0 take3 (#9740)
* Optimize Content-Length: 0 handling

Create and use a pre-encoded HttpFields.CONTENT_LENGTH_0 constant
Used the constant in more places
renamed the `putLongField` methods of HttpFields.Mutable to just `put`
Fixed wrong docs examples
2023-05-07 19:22:15 +02:00
Jan Bartel 11a67fbdd7
Issue #9731 infinite loop in role refs (#9732)
* Issue #9731 infinite loop in role refs

* Update jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/UserIdentityScope.java

Co-authored-by: Greg Wilkins <gregw@webtide.com>

---------

Co-authored-by: Greg Wilkins <gregw@webtide.com>
2023-05-06 00:58:22 +10:00
Simone Bordet baf72248aa
Fixed tests after merge.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-04 22:36:00 +02:00
Simone Bordet 3463e42861
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-04 12:08:00 +02:00
Lachlan Roberts e79cf08d05 removing deprecated PushSessionCacheFilter in 12.0.x
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-05-04 09:52:21 +10:00
Lachlan Roberts bc681a7539 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-05-04 09:48:38 +10:00
Simone Bordet adf5754836
Fixes #9552 - Jetty 12 - Rewrite of the Jetty WebSocket APIs. (#9652)
* Removed unnecessary classes, among which `BatchMode`, `CloseStatus`, etc.
* Coalesced all listener interfaces into `Session.Listener`.
* Moved `RemoteEndpoint` functionality to `Session`.
* Renamed `WebSocketPolicy` to `Configurable`.
* Renamed `WriteCallback` to just `Callback`, as it is now also used for some listener methods.
* Renamed `@OnWebSocketConnect` to `@OnWebSocketOpen`
* Renamed `Session.Listener.onWebSocketConnect()` to `onWebSocketOpen()`.
* Removed `@WebSocket` annotation attributes, because they were just a subset of the configurable ones and they can be configured directly on the Session instance.
* Removed `Session.suspend()` and `SuspendToken`, and introduced `Session.demand()`.
* Introduced `@WebSocket.autoDemand` and `Session.Listener.AutoDemanding` to support automatic demand upon exit of WebSocket handler methods.
* Removed `FrameHandler.isAutoDemanding()` and `CoreSession.isAutoDemanding()`.
* Changed the responsibility of demand from `WebSocketCoreSession` to `FrameHandler`, which in turn may delegate to `MessageSink`.
* Updated MessageInputStream to fail if an exception is thrown by the application.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-02 16:42:40 +02:00
Greg Wilkins 7275bf15a9
Jetty 12.0.x core security (#9405)
core security module

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: gregw <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-02 15:35:49 +02:00
Lachlan 0271077f46
Merge pull request #9678 from eclipse/jetty-12.0.x-9466-DeploymentException
Issue #9466 - review where we throw DeploymentException for WebSocketContainer.connectToServer
2023-05-01 14:27:22 +10:00
gregw 063a3337d9 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-04-29 13:37:16 +02:00
Lachlan Roberts cf32a9cc8c Issue #9466 - review where we throw DeploymentException for WebSocketContainer.connectToServer
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-04-26 11:05:53 +10:00
Jan Bartel 5b4a0136b6
Remove unused session methods. (#9658) 2023-04-24 19:42:44 +10:00
Simone Bordet 7ffdd7fd05
Removed unnecessary "Adapter" classes.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-04-21 18:49:51 +02:00
Olivier Lamy 46018e6057
Jetty-12.0.x tests in parallel (down build time on CI from 1h25 to 55min) some modules are still not parallel due to some static usage (#9635)
* parallel tests runs

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-04-21 10:42:12 +10:00
Simone Bordet 8fe3dbad16
Fixes #9438 - Jetty 12: Review JakartaWebSocketClientContainer use of… (#9626)
* Simplified the use of reflection.
* Improved `setShutdownContainer()` to take into account multiple web applications,
so it is now a `Map<ClassLoader, ContainerLifeCycle>` so that each web application
has its own container to register `JakartaWebSocketClientContainer` instances.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-04-13 09:50:18 +02:00
Lachlan Roberts 47af2a378f Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-04-11 14:08:13 +10:00
gregw 46eb5c7966 Extended fix from #9629
Allow 400 or EOF for more multipart tests
2023-04-10 13:23:42 +02:00
Simone Bordet 744b37f80b
Fixes #7608 - Jetty-12 MetaData cleanup needed (#9618)
* Removed unnecessary constructors from MetaData, MetaData.Request and MetaData.Response.
* Removed MetaData.Request.getURIString() (available as getHttpURI().toString()).
* Renamed MetaData.getFields() -> getHttpFields(), as they can be headers or trailers.
* Renamed MetaData.Request.getURI() -> getHttpURI().
* Normalized handling of contentLength, now always -1 (rather than Long.MIN_VALUE) if unknown.
* Permutated MetaData.Response constructor parameters to be consistent with MetaData.Request.
* MetaData.Request's method and httpURI must be non-null.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-04-07 21:23:01 +02:00
Simone Bordet 110e092a6e
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-04-06 16:18:58 +02:00
Greg Wilkins 10abcbcf8e
Fix MultiPartServletTest race. (#9629)
The writing of the large content may see an EofException before the 400 response has been processed and delivered to the listener.
2023-04-05 22:41:13 +02:00
Greg Wilkins 8636666eec
Jetty 12 - Remove ISO-8859-1 fallback decoding during UTF-8 decoding (#9507)
* Deleted the Ut8fStringBuffer and Utf8Appendable classes in favour of just having Utf8StringBuilder
* Simplified the Utf8StringBuilder and CharsetStringBuilder APIs and improved their exception throwing.
* Allow for replacement characters without throwing

---------

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: gregw <gregw@webtide.com>
Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-04-04 10:57:07 +02:00
Greg Wilkins 693ac7ffbf
Jetty-12 Core Session listeners (#9499)
Added lifecycle and value listeners to jetty core session (needed for core security).

Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Olivier Lamy <olamy@apache.org>
2023-04-03 15:23:10 +02:00
Joakim Erdfelt 9b7763c9be
Jetty 12 - Review BOMs (#9551)
* Fixes #9467 - Review BOMs
* Skip deploy of select test artifacts
2023-03-29 16:34:02 -05:00
Joakim Erdfelt 420ac22985
Issue #8292 - Align ee9/ee10 quickstart testing (#9546) 2023-03-29 16:33:14 -05:00
Joakim Erdfelt 17b3ffe841
Issue #8740 - Move `org.eclipse.jetty.server.context.ManagedAttributes` to core `jetty-server` (#9549) 2023-03-29 13:01:52 -05:00
Joakim Erdfelt 75dbc52f16
Separate weld versions by ee# (#9544) 2023-03-29 10:25:31 -05:00
Joakim Erdfelt 6ce5a0fbcd
Jetty 12 - Remove CGI servlet (#9516)
* Remove CGI servlet
* Remove CGI references
2023-03-29 09:29:57 -05:00
Simone Bordet 6df856e053
Fixes retrieval of SSL Servlet request attributes. (#9533)
* Removed requestlog attributes that were never used.
* Code cleanups to remove usage of deprecated methods.
* Using MavenPaths.findTestResource* in ee9/ee10 tests to allow ee8 translation to function
* Fixed ClientCertAuthenticatorTest in both ee9 and ee10.
* Removed deprecated ClientCertAuthenticator in both ee9 and ee10.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-03-28 20:31:08 +02:00
gregw 149782ea6c Suppress the correct stack 2023-03-26 10:03:18 +02:00
Joakim Erdfelt 9d69760aa4
Restore jetty 12 AttributeNameTest 2023-03-24 13:45:56 -05:00
Joakim Erdfelt 83b59ae718
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-03-24 13:44:13 -05:00
Simone Bordet 856d3338f2
Fixes #9391 - port/move Jetty WebSocket APIs, client and server to je… (#9469)
* Moved -api, -common, -client to jetty-core/jetty-websocket.
* Implemented jetty-core/jetty-websocket/jetty-websocket-jetty-server using only Jetty core APIs, not Servlet.
* Fixed Graceful shutdown order.
* Fixed mistakes in HttpFieldsWrapper, wrongly calling HttpHeader.name() instead of asString().
* Updated tests to pass cleanly.
* Fixed BOMs and POM dependencies.
* Introduced websocket-jetty.mod and websocket-jetty-client.mod, now used by ee10's Jetty WebSocket.
* Fixed OSGi references to old artifactIds.
* Added test to show how to lookup and use ServerWebSocketContainer from a Handler.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-24 19:42:51 +01:00
Joakim Erdfelt 33c8d9974b
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-03-20 13:58:47 -05:00
Simone Bordet 092a592278
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-20 10:22:23 +01:00
Jan Bartel 38d3d7b8fc
Jetty 12.0.x improve multiversion annotations test (#9492)
* Improve testing of annotation parsing of multiversion jars
2023-03-16 18:54:04 +11:00
Joakim Erdfelt 71e94a57c0
Merge pull request #9481 from eclipse/fix/12.0.x/dependency-updates-report
Jetty 12 - Dependency Updates and Report Script
2023-03-14 06:06:56 -05:00
Greg Wilkins bd0186c2f7
Jetty 12.0.x 9444 servlet paths fully decoded (#9479)
getServletPath and getPathInfo will never return an encoded path segment. Instead, they will throw an IllegalArgumentException if they are called when there is a URI with violations.

Signed-off-by: gregw <gregw@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-03-11 14:13:09 +01:00
Greg Wilkins b63c5ef611
HttpMessage interface for BadMessageException
Convert class BadMessageException to a HttpMessage.RuntimeException to allows different types of HttpExceptions exceptions.
This follows the pattern of the QuietException interface.
2023-03-10 09:59:05 +01:00
Joakim Erdfelt 3de4323b20
Fix typo in comment 2023-03-09 09:57:14 -06:00
Joakim Erdfelt 1a3f8becd0
Update <ruleSet> for ee9 2023-03-09 09:56:42 -06:00
Jan Bartel f9a018105d
Issue #9459 empty session path in cookie (#9477) 2023-03-10 00:38:52 +11:00
Jan Bartel 9f9868b754
Issue #9463 NPE in ee10 maven plugin startup (#9475)
* Issue #9463 NPE in ee10 maven plugin startup
2023-03-10 00:34:31 +11:00
Joakim Erdfelt 20404f760c
<onlyUpgradable> set to true 2023-03-09 06:36:35 -06:00
Joakim Erdfelt 16e98f72de
Adding jna test scope dep to ee9 test-loginservice 2023-03-08 17:03:01 -06:00
Joakim Erdfelt 7f52d4f3f0
Set <onlyProjectDependencies> config to true 2023-03-08 16:13:27 -06:00
Joakim Erdfelt 0feff8d35a
Ignoring jetty releases and maven alpha/beta versions 2023-03-08 16:08:09 -06:00
Ludovic Orban 71c2ef2360 #9412 ee9: Fixed missing callback failure when ws endpoint cannot be instantiated
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-03-08 15:03:19 +01:00
Olivier Lamy def35351f3 disable for now m-invoker-p for jetty ee9 runner as already disable for jetty ee10 runner
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-03-08 21:31:54 +10:00
Jan Bartel ed04e19282 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-02-22 16:18:07 +11:00
gregw b720d65f4f Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-02-21 22:01:31 +11:00
Lachlan Roberts d6ff799588 Issue #9182 - make JakartaWSSCI.initialize() and JakartaWebSocketServerContainer public
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-17 18:02:49 +11:00
Lachlan 81046650ab
Merge pull request #9356 from eclipse/jetty-12.0.x-websocket-JPMS
cleanup of websocket to fix JPMS warnings
2023-02-17 15:30:54 +11:00
Lachlan Roberts 229b300f22 rename WebSocketUtil to WebSocketUtils
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-17 11:37:01 +11:00
Lachlan Roberts eb493f1b9d make WebSocketCoreSession public & other fixes
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-17 11:33:02 +11:00
Jan Bartel ea042776bd
Reinstate ee9 jetty runner. (#9383) 2023-02-17 08:34:14 +11:00
Greg Wilkins 0ca6295cbc
Rename process to handle (#9385)
Renamed Request.Processor to Request.Handler
Renamed Handler.process to Handler.handle
Renamed Rule.Processor to Rule.Handler.
Renamed accordingly methods and variable.
Updated comments accordingly.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-16 18:21:12 +01:00
Jan Bartel dd792b5607
Remove jetty-ant (#9382) 2023-02-16 13:48:29 +11:00
Lachlan Roberts 43718f3e52 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-websocket-JPMS 2023-02-15 17:12:59 +11:00
Lachlan Roberts e25c936802 remove exporting of internal packages in ee9 & ee10 websocket
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-15 16:59:29 +11:00
gregw a15af55a56 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
Signed-off-by: gregw <gregw@webtide.com>
2023-02-15 15:31:33 +11:00
Jan Bartel e89b0ebc17 Restore non cross-context async session tests 2023-02-15 14:58:16 +11:00
gregw 015e3d761c Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
# Conflicts:
#	jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java
#	jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/CookieParser.java
#	jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/RFC6265CookieParser.java
#	jetty-core/jetty-http/src/test/java/org/eclipse/jetty/http/CookieCutterTest.java
#	jetty-core/jetty-http/src/test/java/org/eclipse/jetty/http/CookieParserTest.java
#	jetty-core/jetty-http/src/test/java/org/eclipse/jetty/http/RFC6265CookieParserTest.java
#	jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/Cookies.java
#	jetty-http/src/main/java/org/eclipse/jetty/http/HttpCookie.java
#	jetty-http/src/test/java/org/eclipse/jetty/http/CookieCutterLenientTest.java
2023-02-15 14:22:38 +11:00
Lachlan Roberts ce270cf34b fix remaining JPMS issues in websocket-core
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-14 17:25:15 +11:00
Lachlan Roberts 1d8e13220a resolve JPMS issues with CoreSession and WebSocketCoreSession
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-14 15:34:53 +11:00
gregw 4aa6bca630 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
# Conflicts:
#	jetty-core/jetty-server/src/test/java/org/eclipse/jetty/server/ForwardedRequestCustomizerTest.java
#	jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/Request.java
#	jetty-ee9/jetty-ee9-nested/src/test/java/org/eclipse/jetty/ee9/nested/RequestTest.java
2023-02-14 10:07:18 +11:00
Lachlan Roberts cc40a545dc move websocket-core-common messages and util packages out of internal
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-14 09:43:25 +11:00
Simone Bordet e5b313e379
Jetty 12 - Review client notifiers (#9335)
* Introduced ResponseListeners to reduce per-request allocation.
* Removed ResponseNotifier in favor of ResponseListeners.
* Introduced RequestListeners to reduce the per-request allocation.
* Removed RequestNotifier in favor of RequestListeners.
* Removed unnecessary sharing of HttpRequest.requestListeners.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-13 17:36:29 +01:00
Lachlan 55357f4b00
Merge pull request #9328 from eclipse/jetty-12.0.x-websocket-autodemanding
Issue #8991 - rename websocket isDemanding() method to isAutoDemanding()
2023-02-09 20:52:39 +11:00
Olivier Lamy 713bc59289
Merge branch 'jetty-11.0.x' into jetty-12.0.x 2023-02-09 18:28:24 +10:00
Lachlan Roberts 2d11517dd6 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-websocket-autodemanding 2023-02-09 18:22:49 +11:00
Lachlan 3259a55ce3
Merge pull request #9287 from eclipse/jetty-12.0.x-multipartCleanups
Issue #9076 - Cleanups and fixes for multipart in Jetty 12
2023-02-09 18:10:01 +11:00
Lachlan Roberts 820fbb7331 #9287 - catch error in ee9 maxRequestSize MultiPart test
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-09 15:57:50 +11:00
Olivier Lamy b070115dc9
Jetty 12 Hazelcast 5.x and disable auto detection/multicast" (#9332)
* Upgrade to hazelcast 5.2.1
* simplify disable autodetection

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-02-09 08:10:33 +10:00
Lachlan Roberts 341ac15061 #9287 - fix further test failures
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-09 08:37:00 +11:00
Lachlan Roberts d2dcbeba5b Issue #8991 - rename websocket isDemanding() method to isAutoDemanding()
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-08 14:18:02 +11:00
Lachlan Roberts cb511bed8a Issue #9287 - fix failing tests
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-08 13:58:18 +11:00
Lachlan Roberts 6950d73fce Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-multipartCleanups 2023-02-08 11:55:37 +11:00
Ludovic Orban b87f9385c8
Jetty 12: Cleanup `StatisticsHandler` (#9291)
#9145 cleanup statistics

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-02-07 17:43:46 +01:00
Simone Bordet d02932f690
Fixes #9288 - Jetty 12 - Use oej.http.HttpCookie in jetty-client. (#9289)
* Replaced usages of java.net.HttpCookie with oej.http.HttpCookie.
* Moved server-side only methods from HttpCookie to HttpCookieUtils.
* Introduced and implemented oej.http.HttpCookieStore.
* Removed now obsolete oej.util.HttpCookieStore.
* Introduced HttpScheme.isSecure(String), to avoid code duplication.
* Fixed handling of cookie "localhost" domain in HttpClient.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-07 17:28:01 +01:00
Greg Wilkins f565122571
Redo Handler renaming (#9318)
* Redo Handler renaming

Wrapper to Singleton
BaseWrapper to Wrapper

* Updates from review
2023-02-07 16:41:15 +11:00
Lachlan Roberts d005e975b0 changes f rom review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-07 15:47:17 +11:00
Greg Wilkins 461c306fcf cleanup TODOs for decoration
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2023-02-07 07:46:03 +11:00
Simone Bordet 5cc07994c0
Issue #9300 - Rename RetainableByteBufferPool to ByteBufferPool
ArrayRetainableByteBufferPool -> ArrayByteBufferPool.
Updated field names.
Updates tests.
Updated *.mod files to not reference RetainableByteBufferPool.
Updated javadocs.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-06 10:31:14 +01:00
Simone Bordet 44980ebfc3
Merge branch 'issue/9284' of https://github.com/kohlschuetter/jetty.project into kohlschuetter-issue/9284 2023-02-06 10:16:32 +01:00
Greg Wilkins d5866d3521 Removed TODOs that will not be done. 2023-02-06 17:05:01 +11:00
Greg Wilkins 60a08f5349
Rename Handler Nested & Collection (#9305)
There is now a Handler interface hierarchy:
 + Container is a Handler that has 1 or more contained Handlers.
 + Wrapper is a Container with only 1 handler and a setHandler method.
 + Collection is a Container with n handlers and a addHandler method

class are now:
 + Abstract implements Handler
 + AbstractContainer extends Abstract implements Container
 + BaseWrapper extends AbstractContainer implements Wrapper
 + Sequence extends AbstractContainer implements Collection

 Lots of other associated cleanups
2023-02-06 12:15:35 +11:00
Lachlan Roberts c7e7fd837c Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-multipartCleanups 2023-02-06 11:18:19 +11:00
Olivier Lamy 4812eb1c89
Merge branch 'jetty-11.0.x' into jetty-12.0.x-merg 2023-02-05 16:34:58 +10:00
dependabot[bot] 44cd3ee541
Bump maven.surefire.plugin.version from 3.0.0-M5 to 3.0.0-M8 (#9255) 2023-02-05 15:58:03 +10:00
Christian Kohlschütter b8ab66fd1d Rename RetainableByteBufferPool to ByteBufferPool
With issue #9166, ByteBufferPool was removed and replaced by
RetainableByteBufferPool. Since ByteBufferPool was used by
AbstractConnector, this change broke backwards compatibility with
third-party connectors such as junixsocket-jetty.

Since there's no longer any other ByteBufferPool, rename the
RetainableByteBufferPool interface, and thereby not only reinstate
compatibility with existing third-party libraries but also save a few
keystrokes.

https://github.com/eclipse/jetty.project/issues/9284

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>
2023-02-04 23:39:29 +01:00
Simone Bordet 55a27fc68c
Issue #9293 - Jetty 12 - Relax JPMS dependencies. (#9296)
Relaxed jetty-http2 and submodules JPMS dependencies.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-03 10:19:41 +01:00
Olivier Lamy b93a115ecd
Jetty 12 - Rename sessions tests with ee# version in package name (#9231)
* rename sessions tests with eeX version in package name as it, we can indentify which test is failing with junit result
* get rid of some duplicate classes

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-02-03 10:49:44 +10:00
Greg Wilkins ebc6cca478
Jetty 12 - Added a core Session abstraction (#9223)
* Added a core Session abstraction

Sessions were already a core mechanism, but there was no API for them.
There is now a new Session interface that is available via the Request API.  It is intended only for users of sessions.
The previous concrete class Session has been renamed to ManagedSession and it is used by classes that extend AbstractSessionManager.

* Fixed tests

* Use static method

* Updates from review

* Updates from review

Improved javadoc
used util Attributes interface.
2023-02-02 21:40:17 +11:00
Joakim Erdfelt 490f86e9a6
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-02-01 19:33:43 -06:00
Jan Bartel 7e67e33d3c
Jetty 12.0.x reenable jetty ee9 tests (#9224)
* Restore tests in ee9
2023-02-01 15:04:35 +11:00
Lachlan Roberts 4ffad09335 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-9066-MultiPart-getParameters 2023-02-01 12:42:35 +11:00
Greg Wilkins 50a88187fa
Jetty 12 - New HTTP Cookie interface (#9205)
Convert HttpCookie to an interface.
2023-01-31 10:02:28 +11:00
Joakim Erdfelt f80ae9a96e
Bump versions.maven.plugin.version to 2.14.2 2023-01-30 13:55:12 -06:00
Simone Bordet 4d7c38f3eb
Fixed dependency management in jetty-ee9-test-sessions and jetty-ee10-test-sessions.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-30 17:38:59 +01:00
Simone Bordet 59e55ce3aa
Merge pull request #9220 from eclipse/fix/jetty-12-reorganize-session-tests
Jetty 12 reorganized session tests.
2023-01-30 16:53:23 +01:00
Simone Bordet 2e0df218a6
Restored property removed by mistake.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-30 16:52:24 +01:00
Olivier Lamy b0e50748c1
keep matching exception to found errorpage (#9090)
* [TCK] if any matching error page we keep the exception matching the error page found

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-01-28 11:08:52 +10:00
Simone Bordet 7b7cb67cb0
Moved jetty-ee9/test-ee9-sessions to jetty-ee9-tests/jetty-ee9-test-sessions.
Renamed all child modules to comply with the convention.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-27 20:14:38 +01:00
Simone Bordet cd732a175c
Review and normalized all Maven module <name> for consistency.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-27 19:09:30 +01:00
Ludovic Orban 12deee847d #9145 re-enable DynamicListenerTests
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-01-27 17:44:09 +01:00
Ludovic Orban 2424c86b34 #9145 fix websocket modules
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-01-27 17:44:09 +01:00
Simone Bordet ded18f523d
Fixes #9166 - Jetty 12: review/remove ByteBufferPool (#9195)
* Fixes #9166 - Jetty 12: review/remove ByteBufferPool

* Replaced usages of ByteBufferPool with RetainableByteBufferPool.
* Removed ByteBufferPool and related classes.
* Renamed oej.http2.frames.DataFrame.getData() -> getByteBuffer() for consistency.
* Removed Accumulator.acquire(), and updated code to use RetainableByteBufferPool.acquire() instead.
* Fixed HttpOutput callbacks to correctly call super.onCompleteSuccess() and super.onCompleteFailure().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-27 13:40:49 +01:00
Joakim Erdfelt 63d963d526
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-01-26 14:47:19 -06:00
Jan Bartel e271629cfc
Ensure all eeX versions of the plugin use prefix "jetty" (#9156) 2023-01-25 17:36:25 +11:00
Lachlan Roberts 36e7f71def Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-9066-MultiPart-getParameters 2023-01-25 14:23:37 +11:00
Lachlan Roberts d4682f4b85 Fix testMaxRequest size test in MultiPartServletTest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-25 10:39:20 +11:00
Greg Wilkins 39e5667f1d
Jetty-12 Remove usage of HandlerList and reduce usage of Handler.Collection (#9191)
* Remove usage of HandlerList and reduce usage of Handler.Collection

"The best part is no part" - Elon Musk!

The overwhelming usage of `HandlerList` and `Handler.Collection` was for adding the `DefaultHandler` after the main handler.  This PR adds a getter/setter for a `DefaultHandler` on the server, so we no longer need to always create a `Handler.Collection` structure.   This has allowed the deprecated `HandlerList` and `HandlerWrapper` classes to be removed.

In implementing this PR, several problems were found in the calculation of `InvocationType`, not least that it was assumed that an empty `Handler.Collection` was `BLOCKING`.  When this issue was fixed, any dynamic addition of contexts (deployer or SPI server) failed as the `InvocationType` changed.  So this PR also introduces the `isDynamic()` attribute of all `Handler.Container`s.  A dynamic container will always return `BLOCKING` from `getInvocationType()`, as there is always a race with a new handler being added.   A non-dynamic container will return a real `InvocationType`, calculated from its children, but it's mutator methods will ISE if contained handlers are changed.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-25 08:08:09 +11:00
Jan Bartel ad344c7d23
Uncomment websocket deps for ee9 jetty maven plugin (#9189)
* Uncomment websocket deps for ee9 jetty maven plugin

* Update jetty-ee8-maven-plugin pom
2023-01-24 18:22:35 +11:00
Greg Wilkins 99fdd219b7
Jetty 12.0.x 9131 remove path watcher (#9158)
* Reverted to Scanner for PropertyUserStore
* Remove PathWatcher from unassembled fork mode.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
2023-01-20 08:03:27 +11:00
Greg Poulos 06efbcaa7c
Jetty 12.0.x document modules (#9151)
* Add documentation in "Standard Modules" section for the jmx module
* Add documentation in "Standard Modules" section for the ee8,9,10-webapp modules
* Use shorter markup tags to transclude documentation from .mod files
* Extract EE version strings into variables
* Replace literal usages of EE version numbers with custom attribute
* Use convention 'eeN' instead of 'eex' in filenames
* Update metadata tag for deploy module documentation
* Update deploy module documentation to discuss EE platform-specific deploy modules
* Add documentation for the resources module
* Add resources module into section table of contents
* Use jetty-home instead of JETTY_HOME as documentation attribute

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-19 19:02:42 +01:00
Joakim Erdfelt a37b8523e5
Jetty 12 - Javadoc cleanup & new inspection profile (#9165)
* Adding intellij-javadoc-inspection.xml for Jetty specific Javadoc inspection profile.
* Javadoc cleanup
2023-01-19 10:31:27 -06:00
Simone Bordet 0a002d7785
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-19 15:23:13 +01:00
Jan Bartel 7005300421 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-01-18 10:24:39 +11:00
Lachlan Roberts 539113df7c Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-9066-MultiPart-getParameters 2023-01-17 15:12:38 +11:00
Greg Wilkins 94991c60c0
Jetty 12 temp directory cleanup (#9153)
+ `Server` now has setter/getter for a temp directory, which can be null
 + `Context` now has a getter for a temp directory, which is never null 
 + Server root Context temp directory is either whatever is set, else a work directory, else java.io.tmpdir
 + WebInfConfiguration will still create a temp directory name, but defers to ContextHandler for creation/persistence of the temp directory
 + temp directory (and BASE) removed from the deployer, as it is now the server temp directory.
2023-01-17 11:44:09 +11:00
Olivier Lamy 58f5e468fc
jetty 12.0.x cleanup duplicate osgi pom metadata (#9093)
* fix naming convention, artifactId == directtory, add comment on maven-eclipse-plugin
* cleanup dependencies from jetty-ee9 osgi
* cleanup dependencies from jetty-ee10 osgi
* remove maven-eclipse-plugin configuration
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-01-16 11:39:37 +10:00
Greg Wilkins 8b3bcc3a50
Cleanup non-retainable `Retainable`s (#9159)
`Retainable`s that return false from `canRetain()` now are noops if `retain()` is called, which allows for a simpler calling convention.
`AsyncContent` has also been reworked to allocate less and be clearer in its use of `canRetain()`.
2023-01-13 10:37:16 +01:00
Simone Bordet 46355c6110
Fixes retainability of special Chunks (#9073)
* Fixes #8993 - Retainability of special Chunks

* Restored Jetty 11's AsyncContentProducer and related classes in jetty-ee9-nested module (src and test).
* Introduced Retainable.canRetain().
* Removed Chunk.isTerminal() and replaced it with alternative method calls.
* Clarified AsyncContent.write() in case of Chunk.Error.
* Removed AsyncContent.write(Chunk, Callback) because it was making the API confusing.
  For example, AsyncContent.close() clashing with write(EOF, NOOP), or
  AsyncContent.fail(x) clashing with write(Chunk.Error, NOOP), etc.
* Improved usage of Chunk.from(..., Retainable).
* Improved usage of Chunk.slice().
* Using from() in MultiPart, rather than duplicating code.
* Fixed MultiPart.Parser.Listener.onPartContent() javadocs.
* Renamed non-retaining Chunk.from() to Chunk.asChunk().
* Removed Chunk.slice() methods, inlining them where necessary.
* Carefully reviewed all usages of read()-like methods that return a Retainable instance to make sure it is released.
* Updated HTTP/2 and HTTP/3 usages of Stream.Data to follow the correct retain/release semantic.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-13 01:10:56 +01:00
Lachlan Roberts 02f9cc0eb3 fixes to pass new multipart test cases
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-12 19:21:00 +11:00
Lachlan Roberts 1ff251c9b3 add more tests for multipart
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-12 19:20:33 +11:00
Simone Bordet a1c5cefd0d
Reorganization of jetty-client classes. (#9127)
* Reorganization of jetty-client classes.

* Moved oej.client.api to oej.client
* Moved oej.client.util to oej.client
* Moved implementation classes to oej.client.internal
* Moved transports to oej.client.transport
* Moved transport implementation classes to oej.client.transport.internal
* Moved TunnelRequest to oej.client.internal.

* Moved FastCGI transport classes to o.e.j.fcgi.transport
* Moved FastCGI transport implementation classes to o.e.j.fcgi.transport.internal

* Updated WebSocket core client to use only exported, non-internal, oej.client classes.

* Expanded oej.client.Destination APIs:
  - added: getOrigin(), isSecure(), getProxy(), getConnectionPool(), getHttpClient(), send(..).
  - removed: getScheme(), getHost(), getPort() because they don't uniquely identify a Destination anymore (Origin does)
* Moved destination sweeper functionality from HttpDestination to HttpClient.
  HttpDestination does not implement close() anymore, now relies on LifeCycle.stop()
* Moved HttpReceiver.storeCookie() logic to HttpClient.putCookie() to avoid exposing CookieManager.
* Moved HttpClient.getAcceptEncodingField() to ContentDecoder.Factories

* Avoid public/protected Logger instances.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-11 10:05:43 +01:00
Ludovic Orban fcbdab8b3e
Rework client content listeners (#8981)
* Removed DemandedContentListener
* Updated AsyncContentListener signature
* Updated documentation

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-04 11:01:18 +01:00
Olivier Lamy f3d3e0349d
Merge branch 'jetty-11.0.x' into jetty-12.0.x 2022-12-29 17:40:36 +10:00
Olivier Lamy 082e972793
fix missing merging both classes (#9091)
use separate package name to be able to understand which test fail in Jenkins
Signed-off-by: Olivier Lamy <olamy@apache.org>
2022-12-27 09:05:36 +10:00
Olivier Lamy 56af845cf1
Merge branch 'jetty-11.0.x' into jetty-12.0.x 2022-12-26 09:31:36 +10:00
Lachlan 0e95953be3
Merge pull request #9043 from eclipse/jetty-12.0.x-httpcontentFactoryCleanup
Create StaticHttpContentFactory and other cleanups
2022-12-23 22:54:38 +11:00
Jan Bartel 1abaeb6cee
Jetty 12.0.x osgi (#9068) 2022-12-21 08:12:44 -06:00
Olivier Lamy 964e44527d fix package change with new groovy 4.x version
Signed-off-by: Olivier Lamy <olamy@apache.org>
2022-12-21 22:04:00 +10:00
Greg Wilkins c18e790858
Jetty 12 handler as boolean processor (#9035)
Alternative Handler architecture.

All Handlers are Processors, which now return a boolean to indicate the request has been accepted.
The request/response/callback are no longer modal, so there is no race with the boolean return.

Optimized PathMappings.
Avoid iterations if only ServletPathSpec instances
Avoid tests for empty mappings.
Better reset implementation
Improve suffix matching
Improve exact matching

Renamed HttpStream.getNanoTimeStamp() to getNanoTime().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2022-12-19 16:02:26 +01:00
Lachlan Roberts 06f9e5ec18 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-httpcontentFactoryCleanup 2022-12-19 21:46:05 +11:00
Jan Bartel dc49639444 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-12-19 10:11:49 +11:00
Lachlan Roberts 0f1420fbd7 changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-12-16 17:17:12 +11:00
Jan Bartel f139b66d63
Issue #9046 Fix tck session invalidate test (#9047) 2022-12-14 08:25:52 +11:00
Lachlan Roberts 9270e62f78 rename of StaticHttpContentFactory
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-12-13 10:44:35 +11:00
Lachlan Roberts abc40afd89 cleanups for HttpContent Factories
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-12-13 09:55:55 +11:00
Olivier Lamy 139d3f2a41
response#getWriter should throw UnsupportedEncodingException in case of bad character encoding used (#9037)
* response#getWriter should throw UnsupportedEncodingException in case of bad character encoding used

Signed-off-by: Olivier Lamy <olamy@apache.org>
2022-12-13 08:47:52 +10:00
Simone Bordet 119996c16f
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-12-07 19:28:05 +01:00
Joakim Erdfelt 2d9c735d63
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-12-06 14:38:53 -06:00
Greg Wilkins e682f73d54
Cleanup of TypeUtil and ContextHandler stop/start (#8998)
* Extracted some non controversial cleanups from another mega PR:

 + TypeUtil class shortname used more often and includes trailing digits
 + Fixed direct stopping/starting of a nested ContextHandler
 + Fixed null path handling in nested context
 + more tests for all of the above

* Extracted some non controversial cleanups from another mega PR:

Fixed nested doStart and doStop

* Extracted some non controversial cleanups from another mega PR:

Fixed DistributionTests
2022-12-06 15:43:31 +11:00
Jan Bartel 91c7a51cbc
Issue #8921 Fix normalization of META-INF resources for quickstart (#8922)
* Issue #8921 Fix normalization of META-INF resources for quickstart
2022-12-06 08:51:44 +11:00
Greg Wilkins f59eaa58c9
Fix #8980 addJars to WebAppClassLoader (#8982)
List of resources is a list of resources, not a combined resource.
2022-12-01 15:08:13 +11:00
Greg Wilkins 011a7267de
Cleanup ContextHandler (#8928)
* Cleanup ContextHandler

Extracted some of the goodness from #8793:
 + Clear enter/exit scope methods rather than opaque suppliers and Runnables
 + Removed overloading of "Context" class name to avoid accidental usage of wrong type.
 + Less holding onto request/response as fields

* Cleanup ContextHandler

fixed test with no server

* Updates from review.
2022-11-25 14:27:39 +11:00
Greg Wilkins 2460b86d41
Jetty 12 recycle servlet channel (#8909)
Recycle ServletChannel 
Cleanup caching comments and impl
Don't recycle after completion notification
Delay setting callback until ServletHandler.handle called
Check that the retrieved ServletChannel is for the same context.
2022-11-24 13:56:43 +11:00
Jan Bartel c4e1db57ee Issue #8460 simplify DefaultSessionIdManager start (#8464)
* Issue #8460 check DefaultSessionIdManager is started
2022-11-24 09:43:57 +11:00
Greg Wilkins a44af984b5
Jetty 12 mimetype cleanup (#8919)
MimeTypes now available via context.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2022-11-23 14:30:11 +11:00
Joakim Erdfelt b7d7e53ac7
Merge pull request #8924 from eclipse/fix/jetty-12-fileid-getextension-jdk-20
Jetty 12 - Align `FileID.getExtension()` with JDK20 behaviors
2022-11-22 08:24:03 -06:00
Jan Bartel 07202102b8
Jetty 12 - Re-enable some disabled session tests. (#8714)
* Re-enable some disabled session tests.

* Add needed test resources to ee8 jdbc session test.
2022-11-22 17:25:06 +11:00
Joakim Erdfelt 95e149b236
Issue #8923 - Fixing WebAppClassLoader expectations 2022-11-21 16:20:27 -06:00
Greg Wilkins 11fdbbef02 Fixed switch statement style and format 2022-11-22 09:16:08 +11:00
Simone Bordet 71e0414cbc
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-21 15:52:11 +01:00
Simone Bordet e7f6f6729a
Restored server push functionality. (#8760)
* Restored server push functionality.

* Moved Request.isPushSupported() to ConnectionMetaData.
* Removed HttpStream.isPushSupported().
* Implemented ee10 PushBuilder.
* Moved PushCacheFilterTest from core to ee10.
* Duplicated PushCacheFilterTest to ee9.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Greg Wilkins <gregw@webtide.com>
2022-11-21 12:18:19 +01:00
Jan Bartel 9cb6cc62d5 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-11-21 13:15:27 +11:00
Joakim Erdfelt 18f22816c9
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-11-17 13:01:00 -06:00
Greg Wilkins f7d8ea67f6 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
# Conflicts:
#	jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/ResourceService.java
#	jetty-server/src/test/java/org/eclipse/jetty/server/handler/ResourceHandlerTest.java
2022-11-17 13:01:45 +11:00
Simone Bordet ec690e2809
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-16 22:04:35 +01:00
Simone Bordet da67879cf1
Fixed inconsistencies in naming for styleSheet.
Some classes had the second S capitalized, some did not, so now stylesheel -> styleSheet.

CSS has 2 "S" for "S"tyle"S"heet.
Also, the DOM API and the Swing API have "StyleSheet".

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-16 12:18:23 +01:00
Lachlan d72e39757d
Merge pull request #8767 from eclipse/jetty-12.0.x-HttpContent-Caching-Refactor
Refactor and improvements to HttpContent Factories
2022-11-16 12:42:32 +11:00
Lachlan Roberts eff404cf7d Re-enable and fix StatisticsServletTest for ee9
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-11-14 09:37:26 +11:00
Joakim Erdfelt a636a7d153
Adding some more test tags 2022-11-10 10:14:58 -06:00
Lachlan Roberts 126658145c remove setter for HttpContentFactory on ResourceHandler
revert to using computeIfAbsent on CachingHttpContentFactory
make direct buffers configurable on CachingHttpContentFactory

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-11-11 00:49:55 +11:00
Lachlan Roberts bff3c83726 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-11-10 17:38:46 +11:00
Lachlan Roberts 7cccd9629f Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-11-10 17:05:00 +11:00
Lachlan Roberts eeb4df9965 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-HttpContent-Caching-Refactor 2022-11-10 16:20:30 +11:00
Lachlan Roberts 1c6d36e44a changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-11-10 16:16:51 +11:00
Joakim Erdfelt 08c47f5f57
Jetty 12 - use JVM provided null OutputStream (#8789)
* Remove IO.getNull* methods and use JVM versions

+ This also honors the open/close/error on
  bad use of the streams/writers
2022-11-09 07:06:43 -06:00
Simone Bordet e2e4d256e7
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-09 12:23:27 +01:00
Lachlan Roberts 5fec1801f5 add getters and setters for HttpContentFactory onto ResourceHandler
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-11-09 14:20:52 +11:00
Lachlan Roberts a4e773a7ab changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-11-09 14:10:49 +11:00
Joakim Erdfelt aa9df2a402
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-11-08 18:16:45 -06:00
Simone Bordet bb3355be83
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-08 22:26:39 +01:00
Lachlan Roberts 75f210d20b Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-HttpContent-Caching-Refactor 2022-11-08 21:22:53 +11:00
Simone Bordet 4225544222
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-07 19:34:43 +01:00
Joakim Erdfelt b3505ae687
Jetty 12 - General cleanup of URIUtil (#8861)
+ Removal of __CHARSET
+ Removal of unused methods
+ Using new switch/case concepts
+ cleanup of URIUtil constants
+ cleanup of URIUtil methods
+ collapse separate methods
+ simplify encodePath()
* Javadoc updates
* equalsIgnoreEncoding cleanup (no longer used by Resource layer)
2022-11-04 14:28:53 -05:00
Lachlan Roberts c0bb0272f7 fix release in CachingHttpContentFactory and always use ByteBufferPool
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-11-03 17:38:22 +11:00
Lachlan Roberts 6facedba75 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-HttpContent-Caching-Refactor 2022-11-02 17:28:42 +11:00
Lachlan Roberts e28a528165 changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-11-02 17:21:44 +11:00
Greg Wilkins 976ab3df8d
ResourceCollection should not have a path (#8711)
ResourceCollection should not have a path
Nor name, nor filename unless all resources agree on it.
revert combine and related methods to return Resource and not explicitly a ResourceCollection, as if there is only 1, then a collection is not needed
cleanup ResourceCollection creation. Avoid sanity checks on resolved resources.
2022-11-01 15:54:50 +11:00
Greg Wilkins 3b2d4048fd replaced getPathInContext with static method
updates from review
2022-10-25 21:11:10 +11:00
Greg Wilkins 9dc9eaa711 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12-static-pathInContext 2022-10-25 20:42:25 +11:00
Gili Tzabari 0724d1090d
Fixes #8723: Provide a thread-safe way to modify HttpClient proxies at runtime. 2022-10-25 10:23:04 +02:00
Lachlan Roberts 7752720861 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-HttpContent-Caching-Refactor 2022-10-25 16:44:53 +11:00
Lachlan Roberts 02e0a3993c cannot add ContentFactory to servletContext attribute as there may be multiple factories in a single context
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-25 16:39:42 +11:00
Greg Wilkins 6c9d34c26a Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12-static-pathInContext
# Conflicts:
#	jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/DefaultServlet.java
2022-10-25 09:11:40 +11:00
Simone Bordet 660093ff3a
Code cleanups.
Removed obsolete oej.server.HttpTransport.
Cleaned up ConnectionMetaData.Wrapper.
Simplified ee10 DefaultServlet.ServletCoreRequest.
Other minor cleanups.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-24 16:25:53 +02:00
Greg Wilkins 465ddf0932 WIP replacing getPathInContext with static method 2022-10-24 17:55:16 +11:00
Greg Wilkins 30401d8cf8 WIP replacing getPathInContext with static method 2022-10-24 11:26:50 +11:00
Greg Wilkins 1885df7e03 WIP replacing getPathInContext with static method 2022-10-23 22:36:15 +11:00
Ludovic Orban 38289e46d4
Make Client's Request and Response `abort()` fully async (#8725)
Changed Request and Response abort() to be fully async by returning a CompletableFuture<Boolean>

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-10-21 15:32:46 +02:00
Lachlan 30138e9d03
Merge pull request #8742 from eclipse/jetty-12.0.x-websocket-disabled-tests
Re-enable and fix websocket tests for Jetty 12 ee9 and ee10
2022-10-21 13:08:55 +11:00
Greg Wilkins ac6abb307d
ResourceHandler set base resource as string (#8735)
* ResourceHandler set base resource as string

* ResourceCollection should not have a path

fixed tests
2022-10-21 09:32:54 +11:00
Lachlan Roberts 0e1bae4059 use RetainableByteBuffer for getBuffer in HttpContent
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-20 21:29:55 +11:00
Lachlan Roberts 8768725de9 separate evicting logic from CachingHttpContentFactory
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-20 10:37:38 +11:00
Lachlan Roberts 86da43a54a improve configuration options for HttpContent.Factory
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-20 10:00:04 +11:00
Joakim Erdfelt 259deea2f7
Jetty 12 - Resource `resolve()` and `newResource()` return null on resources that do not exist (#8702)
* Resource `resolve()` and `newResource()` return null on resources that do not exist
* Introduce `Resources` utility methods and use them
* Updating javadoc
2022-10-19 15:50:37 -05:00
Joakim Erdfelt 9061348ec4
Jetty 12 - Simplification of aliases in `PathResource` (Take 2) (#8734)
* simplify the PathResource.resolveTargetPath code
* changes to how PathResource handles aliases
* fix usages of Resource.getTargetUri()
* fixes for FileSystemResourceTest
* update javadoc for Resource.getTargetURI()
* rename getTargetURI to getCanonicalURI
* let resolveCanonicalPath return null if resource does not exist
* add test in PathResourceTest for broken symlinks
* some changes from review + optimization for exists()
* restore name to getTargetUri in Resource
* fix some tests related to PathResource changes
* revert changes to PathResource equals and hashcode
* also compare URI in PathResource
* checkAlias to resolveAlias
* PathResource cleanup
+ Adding comments about class fields.
+ Removing normalization from
  input/output/comparison flows.
+ Collapsing `resolveTargetPath`
  into `resolveAlias` to react
  accordingly to the exceptions
  that can flow out of Path.toRealPath().
+ Failure on Path.toRealPath() is never
  an alias, as the resource cannot ever
  be served anyway.
+ More comments in `resolveAlias()`
+ Failed / Bad / Nonexistent / Inaccessible
  resources are not aliases to anything.
* Renames of targetPath/targetUri
  `targetPath` to `realPath`
  `targetURI` to `realURI`
* Cleanup alias/aliasResolved booleans
* More testcase cleanup around not-exist
* Don't resolve alias on Error during toRealPath
* Add test to check how Alias check behaves if non-existent resource exists later

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-19 11:17:23 -05:00
Lachlan Roberts ad7ae3cfc9 Rename all HttpContent factories
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-19 17:10:15 +11:00
Lachlan Roberts c85f3f40a3 fix all disabled tests in websocket ee9
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-19 16:55:47 +11:00
Simone Bordet 02a7f1cce1
Re-enabled distribution tests that were disabled. (#8722)
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-18 20:10:57 +02:00
Joakim Erdfelt ad406ac44c
Cleaning up test cases with eye on work/temp file management 2022-10-18 07:50:44 -05:00
Lachlan Roberts cccc16c03e Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-HttpContent-Caching-Refactor 2022-10-18 22:28:13 +11:00
Joakim Erdfelt 586d0fd097
Merge branch 'jetty-12.0.x' of github.com:eclipse/jetty.project into jetty-12.0.x 2022-10-17 18:32:35 -05:00
Joakim Erdfelt 3c5fb319ec
Fixing ee9 MetaInfConfigurationTest usage of classpath to be compatible with ee8 conversion. 2022-10-17 17:09:36 -05:00
Simone Bordet 0d0790834d
Moved FastCGIProxyServlet in ee9 to FastCGIProxyHandler in core. (#8718)
Moved FastCGIProxyServlet in ee9 to FastCGIProxyHandler in core.
Moved TryFilesFilter in ee9 to TryPathsHandler in core.
Update Jetty modules to properly setup the class-path in case of proxy usage.

Fixes Surefire configuration to run the tests.
The problem is that fcgi-proxy depends on fcgi-client, so both will be put on the module-path.
However, fcgi-server is used for the tests, it is in the class-path, but depends on fcgi-client that is on the module-path.
Therefore, when a fcgi-server class tries to access a fcgi-client class, JPMS throws because the fcgi-client module does not export to the unnamed module.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-18 00:00:34 +02:00
Joakim Erdfelt 65c5e93351
Fixing checkstyle 2022-10-17 15:33:14 -05:00
Joakim Erdfelt 00c06738f0
Use MavenPaths where appropriate (ee9 -> ee8 conversion helper) 2022-10-17 15:23:24 -05:00
Joakim Erdfelt 1b790d51b4
Use WebAppContext.getResourceFactory() 2022-10-17 15:20:15 -05:00
Joakim Erdfelt f0856a4c7d
Fixed war file unpacking 2022-10-17 15:19:56 -05:00
Joakim Erdfelt a454150e7f
Improved addClassPath and addJars behavior
+ Less code
+ Corrected javadoc
2022-10-17 15:19:32 -05:00
Joakim Erdfelt 3e8697f926
Log bad Classpath URI entries 2022-10-17 15:18:43 -05:00
Joakim Erdfelt 81b1a6688d
Better use of WebAppContext.getResourceFactory() 2022-10-17 15:15:05 -05:00
Joakim Erdfelt 0e25d98a9d
Handle bad ContextHandler.setBaseResource more clearly 2022-10-17 15:10:55 -05:00
Jan Bartel e8b818db15 Reenable ee9 RequestScopedSessionSaveTest. 2022-10-17 17:15:02 +11:00
Jan Bartel a3bf740f42 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-10-17 11:36:40 +11:00
Simone Bordet a6f5e1fe8f
Merge pull request #8705 from eclipse/jetty-12.0.x-reenable-customrequestlog
Jetty 12 - Re-enabled RequestLog tests.
2022-10-14 10:30:12 +02:00
Joakim Erdfelt 45e706cb67
Move Resource.combine() methods to ResourceFactory 2022-10-13 14:08:21 -05:00
Joakim Erdfelt 28d448aef6
Fixing directory location name for additional classpath elements 2022-10-13 09:59:07 -05:00
Joakim Erdfelt b36e4d86c5
New test for tiny names and resource base name 2022-10-13 09:57:41 -05:00
Joakim Erdfelt 5148de7105
Making tokenPath creating reliable 2022-10-13 09:56:43 -05:00
Joakim Erdfelt 06d82d30e5
Making tokenPath creating reliable 2022-10-13 09:56:33 -05:00
Joakim Erdfelt 39f77f7e26
Increasing reliability of test on ee9/ee8 2022-10-13 09:55:57 -05:00
Joakim Erdfelt 0bd1253679
Increasing reliability of test on ee9/ee8 2022-10-13 09:55:45 -05:00
Joakim Erdfelt 2be5a2bda4
Increasing reliability of test when run on different filesystems 2022-10-13 09:55:18 -05:00
Joakim Erdfelt 5ae363d4e1
Increasing reliability of test on ee9/ee8 2022-10-13 09:54:27 -05:00
Joakim Erdfelt fee44a65f5
Adding TODO about odd WEB-INF behavior 2022-10-13 09:54:02 -05:00