Commit Graph

900 Commits

Author SHA1 Message Date
Greg Wilkins 7dcab84b91
Fix jetty 12.0.x transient timeouts (#10844)
Fixes #10234

* Introduced transient failures in reads where a failure chunk has last=false.
* Transient failure now do not fail the handler callback.
* Improve eeN ContentProducer to more carefully assert transient and terminal errors + enable HttpInputIntegrationTest
* Do not add connection: close to the response when the error is transient
* Rework ChunksContentSource to support null chunks
* Added tests to verify the new transient failure cases
* Review all code that handles failure, and handling correctly transient failure, either by making them fatal, and/or by failing Content.Source.

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Chad Wilson <chadw@thoughtworks.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-23 15:25:03 +01:00
Lachlan 4a91cb7464
Merge pull request #10902 from jetty/jetty-12.0.x-addContainerResource
do not add duplicate jars to MetaData containerResources
2023-11-23 08:36:12 +11:00
Lachlan ecb90e8d0f
Issue #10687 - WebSocket remembers mappings on restart (#10773)
* Clear websocket mappings on server stop
* Fix core WebSocketUpgradeHandler on restart
* Avoid usage of deprecated WebSocketUpgradeHandler.configure() method.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-20 17:09:56 +01:00
Simone Bordet da2c601cd7
Fixed flaky test.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-20 09:02:34 +01:00
Lachlan Roberts 9a9d8fb6ea throw IllegalArgumentException if container resource is not readable
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-11-20 10:09:26 +11:00
Simone Bordet e933116997
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-19 22:09:10 +01:00
Lachlan Roberts e7bac208b3 warn on duplicate container resource
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-11-17 16:10:18 +11:00
Lachlan Roberts 96657eb0a7 do not add duplicate jars to MetaData containerResources
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-11-17 13:16:46 +11:00
Ludovic Orban 12e6af1ba3 add the event to the assertion list before writing the response
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-15 11:17:31 +01:00
Jan Bartel 9bf6229e01
Fix leaked resources in jetty maven plugin (#10888) 2023-11-14 23:52:18 +01:00
Greg Wilkins 49b344242b
Various cleanups of Handler.insertHandler (#10792)
* Various cleanups of Handler.insertHandler
* Added missing call to relinkHandlers() in setHandler() after calling super.
* Moved call to relinkHandlers() in insertHandler(), as the various setSession|Security|ServletHandler() already call relinkHandlers().

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

---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-13 23:13:51 +11:00
Greg Wilkins 2c35f5a17a
Immutable local/remote SocketAddress within a ConnectionMetaData (#10867)
The local/remote SocketAddress is cached within the ConnectionMetaData or Connection instance, so that any changes are not visible during the request lifetime.
Ensure that all server Connection types respect HttpConfiguration#getLocalAddress and that it is not implemented only in servlet layer
Avoid DNS resolution.

---------

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-11-13 23:05:20 +11:00
Greg Wilkins 6edd6d0ed0
Improve handling of SSL metadata in ConnectionMetaData, proxied connections and forwarded requests #10775 (#10853)
Improve handling of SSL metadata in ConnectionMetaData, proxied connections and forwarded requests

+ Added an Attributes.Synthetic mechanism to better (and mor commonly) handle additional attributes, whilst meeting the new TCK requirement that they can be deleted or replaced.
+ Made SslSessionData a reusable type provided by EndPoint
+ Added the EndPoint.Securable subtype that can provide a SslSessionData instance for secure EndPoints
+ Updated ForwardedRequestCustomizer, SecureRequestCustomizer to understand Securable and SslSessionData
+ Javadocs improvements.
+ Removed unnecessary attribute constants in SecureRequestCustomizer.

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

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-09 14:07:19 +11:00
Olivier Lamy b88908236e
Jetty 12 add duplicate classes finder plugin to avoid sames classes with different content coming from different jars (#10767)
* add duplicate finder plugin

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-11-07 06:37:41 +01:00
gregw 81814dc226 Recycle ServletChannel at ServletContextHandler completion. 2023-11-02 07:19:18 +11:00
Greg Wilkins 0ce52b9741
The replaceCookie method renamed to putCookie and refined #10797 (#10803)
Addressed #10797 by make cleanup of addCookie and renaming replaceCookie to putCookie.
Ensured that Jetty code calls putCookie when appropriate.
2023-11-02 07:07:54 +11:00
Greg Wilkins 2773bc7df8
Recycle ServletChannel in ServletContextHandler (#10801)
Recycle ServletChannel in ServletContextHandler rather than in ServletHandler, so that completion events on servlet API request/response can be handled.
2023-11-01 11:16:15 +11:00
Jan Bartel 2cfe7c4e10
Issue #10804 isRequestedSessionId should be false for invalid session (#10807)
* Issue #10804 isRequestedSessionId should be false for invalid session
2023-10-30 23:43:12 +01:00
Joakim Erdfelt ab15891e5e
Merge remote-tracking branch 'origin/release/12.0.3' into jetty-12.0.x 2023-10-30 14:48:25 -05:00
Lachlan 8ac8da777c
Merge pull request #10774 from jetty/jetty-12.0.x-10346-JsrEchoTest
Issue #10346 - fix bug in NetworkFuzzer to de-flake JsrEchoTest
2023-10-30 17:13:46 +11:00
Joakim Erdfelt c01baac85c
Updating to version 12.0.4-SNAPSHOT 2023-10-26 22:47:29 -05:00
Joakim Erdfelt a873259fd5
Updating to version 12.0.3 2023-10-26 22:24:43 -05:00
Joakim Erdfelt 6a70a931eb
Bump weld to 5.1.2.Final 2023-10-26 20:43:11 -05:00
Jan Bartel a5f06fceaf
Add ability to compress and skip unserializable session attributes (#10747)
* Add ability to compress and skip unserializable session attributes
2023-10-26 09:36:45 +02:00
Jan Bartel 3ae43961b8
Jetty 12.0.x overlay combined resources (#10760)
* Fix overlays with CombinedResource
* Improvements to CombinedResource for AnnotationParser
* Added `contains` and `getPathTo` methods to the Resource API, so they can be used by the AnnotationParser
* Fixed numerous bugs in CombinedResource list and getAllResources
* handles cross file system copy as well.
* Reduced fallback to URI string manipulation.

---------

Co-authored-by: gregw <gregw@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-10-26 07:49:48 +11:00
Simone Bordet f12d568e0b
Improvements to the description section.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-25 12:19:09 +02:00
Lachlan Roberts d91905ca18 remove remaining references to PushCacheFilter
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-10-25 16:48:42 +11:00
Lachlan Roberts 829e2a19b7 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-10-25 16:35:42 +11:00
Joakim Erdfelt 33f80838ac
Fixes #10771 - EE10 ServletApi.isSecure() bug with ForwardedRequestCustomizer (#10772) 2023-10-24 11:59:55 -05:00
Lachlan Roberts 247a341bee Issue #10346 - fix bug in NetworkFuzzer to de-flake JsrEchoTest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-10-24 19:10:30 +11:00
Jan Bartel 14a5ba3489
Issue #10661 Allow jetty api to override servlets and mappings from webdefault (#10668)
* Issue #10661 Allow jetty api to override servlets and mappings from webdefault

---------

Co-authored-by: Greg Wilkins <gregw@webtide.com>
2023-10-19 08:35:44 +02:00
Jan Bartel 467f026d37
Jetty 12.0.x 10716 charset printwriter (#10737)
* Issue #10716 tck compliance for setting response charset

---------

Co-authored-by: gregw <gregw@webtide.com>
2023-10-19 05:09:42 +02:00
gregw 524bde565e Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
# Conflicts:
#	jetty-ee10/jetty-ee10-servlets/src/test/java/org/eclipse/jetty/ee10/servlets/AbstractDoSFilterTest.java
#	jetty-ee9/jetty-ee9-servlets/src/main/java/org/eclipse/jetty/ee9/servlets/DoSFilter.java
2023-10-19 09:24:30 +11:00
Olivier Lamy f2ab447c4f
Merge 11 to 12 Issue #10731 wrong context attribute name javax.servlet instead of jakarta.servlet (#10735) and Address build/test failure against bad entities. (#10742) (#10745)
* Issue #10731 wrong context attribute name javax.servlet instead of jakarta.servlet (#10735)

* Issue #10731 wrong context attribute name javax.servlet instead of jakarta.servlet

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

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

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>

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

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>

* fix javadoc

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

* more usage of constant

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

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>

* Address build/test failure against bad entities. (#10742)

Bad entities in test case can lead to:

* external URL references
* required HTTP GET requests
* not testing redirectEntity / resolveEntity
  (the whole point of the test)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* use constant

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

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-10-17 07:29:13 +02:00
Greg Wilkins ffe80cd1f2
MutableHttpFields.asImmutable avoids copy (#10651)
* Avoid a copy in MutableHttpFields.asImmutable if the mutable is never mutated again.
* reduce instance creations needed for iterations
---------
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-10-17 08:58:19 +11:00
Greg Wilkins df6995e125
Fix EE10 removeAttributes (#10727)
Allow all attributes, including synthetic ones, to be removed.
2023-10-16 21:24:46 +11:00
Greg Wilkins 897478a4f6
Fix #10656 return value for HttpServletRequest.getProtocolRequestId() in ee10 (#10715)
Return empty string for HTTP/1.x and previous
2023-10-16 14:52:56 +11:00
Jan Bartel fffbab015d
Jetty 12.0.x 10582 servlethttpwrapper (#10587)
* Issue #10582 fix DispatcherTest use of ServletRequestWrapper
2023-10-12 07:46:04 +02:00
Olivier Lamy fcc88274a4
Jetty 12.0.x use automatic formatter for poms to have same style for every poms (#10578)
* apply spotless sort pom

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-10-12 03:51:36 +02:00
Joakim Erdfelt 6b3f760b80
Updating to version 12.0.3-SNAPSHOT 2023-10-09 21:16:46 -05:00
Joakim Erdfelt b01e3611cf
Updating to version 12.0.2 2023-10-09 20:59:14 -05:00
Simone Bordet 3458f0ef13
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-09 20:06:48 +02:00
Olivier Lamy 8bdf42f652
Issue #7408 fix scope of Maven plugins dependencies and re enable some IT tests (#10660)
* Issue #7408 fix scope of maven dependencies for ee10
* Issue #7408 fix scope of maven dependencies for ee10 jspc and restore it test which were disabled
* Issue #7408 fix scope of maven dependencies for ee9 maven plugin
* Issue #7408 fix scope of maven dependencies for ee9 jspc and restore it test which were disabled
* Issue #7408 fix scope of maven dependencies for ee8 maven plugin
* Issue #7408 fix scope of maven dependencies for ee8 jspc and restore it test which were disabled

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-10-06 02:10:07 +02:00
Greg Wilkins 8331809c40
Fix getCharacterEncoding issue with #10563 (#10650)
Do not persist a defaulted charset used in the request.
Throw `UnsupportedEncodingException` from `getReader`
2023-10-03 12:45:40 +11:00
Greg Wilkins 1a207dbeea
An omnibus PR for changes needed to support webfunctions (#10563)
Web functions are currently supported with servlets. These changes add/move utility classes to core to better support direct usage of core APIs
 * increase usage of Charset in request
 * Added flush mechanism to BufferedContentSink
2023-09-27 09:29:15 +10:00
Olivier Lamy b945ca6e40
Issue #10421 fix jpms warning (#10424)
* remove wrong jpms declaration

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

* remove non valid jpms sections from mod files

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

* more cleanup

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

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-09-26 09:33:41 +10:00
Jan Bartel 65d5664ef4
Issue #10558 Fix ee10 redirect during forward, add ee9 test (#10560)
* Issue #10558 Fix ee10 redirect during forward, add ee9 test
2023-09-23 03:52:08 +02:00
Jan Bartel 0e79cc8cb3
Issue #10466 review session documentation. (#10497)
* Issue #10466 review session documentation.

Also fix session config context init param names and add missing code to
configure SessionHandler via context init params, and added test for
config.
2023-09-22 08:18:29 +02:00
Lachlan 42468ae1bd
Merge pull request #10494 from eclipse/jetty-12.0.x-10490-websocketServerUpgradeRequest
Issue #10490 - fixes and testing for websocket JakartaServerUpgradeRequest
2023-09-21 11:46:28 +10:00
Joakim Erdfelt aefa331aa4
Issue #10328 - Review ResourceFactory.newSystemResource (#10533)
* Issue #10328 - Review ResourceFactory.newSystemResource

+ Create a new ResourceFactory.newClassLoaderResource(String, boolean)
+ Make .newSystemResource(String) use it
+ Make .newClassPathResource(String) use it
+ Deprecate .newSystemResource(String)
+ Deprecate .newClassPathResource(String)
+ Adjust own codebase to not use deprecated methods
2023-09-20 16:43:22 -05:00