Commit Graph

871 Commits

Author SHA1 Message Date
Joakim Erdfelt 33f80838ac
Fixes #10771 - EE10 ServletApi.isSecure() bug with ForwardedRequestCustomizer (#10772) 2023-10-24 11:59:55 -05: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
Lachlan Roberts 665cae2ec2 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-10490-websocketServerUpgradeRequest 2023-09-21 07:24:08 +10:00
Simone Bordet d1a1663b39
Fixes #10324 - Improve migration from Servlets to Handler. (#10529)
* Using request.getLength() instead of looking up the Content-Length header.
* Jetty Handler vs Servlet pros.
* Using CompletableFuture (not Promise) in examples.
* Removed unused cruft from tests.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-20 21:15:20 +02:00
Ludovic Orban a3adb66a7b
Fix checkstyle after 11.0.x merge (#10544)
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-18 11:58:00 +02:00
Greg Wilkins 09710c7cb6
Fix jetty 12 javadoc (#10527)
Fixes for javadoc warnings
2023-09-18 17:30:02 +10:00
Greg Wilkins 4e27d308df
Fix parsing of JSESSIONID only (#10479)
Improved parsing of JSESSIONID cookies and jsessionid parameters.
Better handling of invalid and duplicate session IDs

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
2023-09-18 17:27:28 +10:00
gregw fb80522675 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-09-18 17:25:11 +10:00
Olivier Lamy 057e9eee5e
jetty 12.0.x upgrade dependencies (#10507)
* Junit 5.10.0

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

* slf4j 2.0.9

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

* hazecast 5.3.2

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

* pax exam 4.13.5, pax url 2.6.14

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

* mariadb client 3.2.0

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

* logback 1.4.11

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

* 4.1.97

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

* add exclusions

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

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-09-17 01:17:53 +02:00
Joakim Erdfelt 0068c91bcd
Issue #10508 - honor Servlet spec behaviors for null in addHeader / setHeader calls (#10510)
* Refactor ResponseHeadersTest to modern standards
* Issue #10508 - honor Servlet spec behaviors for null in addHeader / setHeader calls
2023-09-14 11:02:54 -05:00
Simone Bordet 530ed33611
Fixes #10219 - Review HTTP Cookie parsing (#10464)
* Added SetCookieParser interface and RFC6265SetCookieParser implementation to properly parse Set-Cookie values.
* Removed hacky implementation in HttpClient.
* Removed unused methods in HttpCookieUtils.
* Using SetCookieParser for the implementation of newPushBuilder in ee9,ee10.
* Reworked HttpCookieStore.Default implementation.
* Implemented properly cookie path resolution.
* Using URI.getRawPath() to resolve cookie paths.
* Removed secure vs. non-secure scheme distinction when storing cookies.
* Refactored common code in HttpCookieStore.Default to avoid duplications.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-14 17:13:05 +02:00
Simone Bordet 388d3e38fa
Fixes #10361 - Introduce QoSHandler (#10480)
* Introduced QoSHandler.
* Updated documentation, and removed old documentation.
* Now using dynamic max priority.
The current implementation retains priorities and queue as they are created, but hopefully the priority range is constrained.
* Better algorithm for resuming: rather than releasing a permit and try to acquire it again, keep the permit and resume a request.
This also removes the issue that a request could have been suspended again, therefore remaining suspended much more than maxSuspend.
* Deprecated QoSFilters in ee10 and ee9.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-14 15:46:12 +02:00
Simone Bordet 8684b0a67a
Introduced CompletableResponseListener (#10502)
Introduced CompletableResponseListener, a replacement for FutureResponseListener that uses better APIs based on CompletableFuture.

Deprecated FutureResponseListener and replaced its usages.

Updated documentation.

Added tests for zipped request content.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-14 15:33:51 +02:00
Lachlan Roberts c81325492a Issue #10498 - fixes for getUserPrincipal in Jetty WebSocket EE9 & EE10
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-09-14 10:26:02 +10:00
Lachlan Roberts 4bdd21f777 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-10490-websocketServerUpgradeRequest 2023-09-14 09:57:50 +10:00
Jan Bartel 4bbfa3949b
Issue #10440 fix ClassCastException for <jettyEnvXml> in maven plugin (#10493)
* Issue #10440 fix ClassCastException for <jettyEnvXml> in maven plugin

* disable H1 client leak tracking for testInputStreamContentProviderThrowingWhileReading

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

---------

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-09-12 07:49:45 +02:00
Lachlan Roberts 3066737016 Issue #10490 - fixes and testing for websocket JakartaServerUpgradeRequest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-09-11 17:00:02 +10:00
Joakim Erdfelt 1d226403da
Updating to version 12.0.2-SNAPSHOT 2023-08-29 16:55:36 -05:00
Joakim Erdfelt 4768745849
Updating to version 12.0.1 2023-08-29 16:38:20 -05:00
Simone Bordet c638753b8d Fixes #10293 - Improve documentation on how to write a response body in Jetty 12.
Updated documentation about:
* Content.Source
* Content.Sink
* Handler
* Request/Response

Updated few APIs to make easier to write applications.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-29 22:07:42 +02:00
Jan Bartel 5808a62660
Issue #10356 Update Weld integration (#10359)
* Issue #10356 Update Weld integration

Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Olivier Lamy <olamy@apache.org>
2023-08-29 11:00:50 +02:00
Lachlan 76cc130d17
Merge pull request #10420 from eclipse/jetty-12.0.x-10402-ServletChannelRecycle
Issue #10402 - do not recycle ServletChannel if aborted
2023-08-29 15:00:34 +10:00
Lachlan Roberts 0a2cfab4a8 Issue #10402 - rename ServletChannelState open() to openOutput()
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-29 14:59:59 +10:00
Simone Bordet 5a8c5bc8c7
Fixes #10353 - Questions about porting WebSocket APIs to jetty-core 12 (#10354)
* Added direct WebSocket upgrade in the Jetty core WebSocket APIs.
* Updated the WebSocket documentation.
* Optimized WebSocketMappings.getMatchedNegotiator() to avoid allocating a lambda for every invocation.
* Cleaned up core.server.WebSocketUpgradeHandler.
* Expanded websocket docs to mention how the demand mechanism works.
* Fixed code examples with correct demand handling.
* Javadocs for api.Callback.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-28 17:46:12 +02:00
Lachlan Roberts 1c1cc0296b remove debugging printlns
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-28 15:50:14 +10:00
Lachlan Roberts 27d0c7a181 Issue #10402 - do not recycle ServletChannel if aborted
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-28 15:48:29 +10:00
Greg Wilkins 8ed56b3466
Implement containsLast in HttpFields (#10340)
Fully implement list iterator so that we can efficiently check for the last item in a multi header list.

---------

Signed-off-by: gregw <gregw@webtide.com>
2023-08-26 10:05:29 +10:00
Lachlan ff02d3b086
Merge pull request #10394 from eclipse/jetty-12.0.x-10383-AsyncListenerTest
Issue #10383 - suppress stack traces from AsyncListenerTest
2023-08-25 18:14:41 +10:00
Lachlan 5c7a222697
Merge pull request #10313 from eclipse/jetty-12.0.x-10295-formAuthDispatch
Issue #10295 - implement EE10 FormAuthenticator with dispatch option
2023-08-25 16:14:40 +10:00
Lachlan Roberts a4055a21b0 revert change to stopTimeout in AsyncListenerTest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-25 16:09:47 +10:00
Lachlan Roberts b9e915b70e Issue #10383 - Modify ServletChannelState to not warn on QuietExceptions
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-25 15:40:41 +10:00