Commit Graph

351 Commits

Author SHA1 Message Date
gregw b11996a3c4 Introduced EE11 and jetty-12.1.x 2024-04-26 22:42:57 +10:00
Joakim Erdfelt 4cc938429f
Issue #11648 - Introducing HttpDateTime class. (#11672)
+ Introduces HTTP (and Cookie) Date/Time parsing
  according to spec algorithms.
+ Introduces formatting according to spec
  mandated preferred RFC 1123 format.
+ Deprecate DateParser
2024-04-23 17:17:59 -05:00
Greg Wilkins 33feac33e7
Revert "Revert NON_POOLING change" (#11649)
This reverts commit 2bf7d6cecc.
2024-04-18 15:52:03 +10:00
Joakim Erdfelt b3ef872d6b
Updating to version 12.0.9-SNAPSHOT 2024-03-29 15:20:11 -05:00
Joakim Erdfelt ffffdcc3c8
Updating to version 12.0.8 2024-03-29 14:31:57 -05:00
Greg Wilkins 9b6944e04a
Remove usages of URIUtil.toURI and URIUtil.split (#11577)
* Issue #11567 - fix relative path for resourceBase set in DefaultServlet

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>

* Remove the ResourceFactory adaption from between baseResource and a HttpContent.Factory

* Remove toURI usage

* ensure ee9 DefaultServlet encodes the pathInContext

* Moved toURI functionality to ResourceFactory

* use context baseResource if baseResource not set

* removed usages of URIUtil.split

* fixed javadoc

* updates from review

* updates from review

* updates from review

* updates from review

* fixed resource leak in test

* fixed resource leak in test

* updates from review

* Fixes to URIUtil for Windows (#11585)

* Fixes for Windows
* Remove test that is not needed

* inlined resolveOrNew

---------

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-03-28 16:32:03 +01:00
Ludovic Orban 89c41b2550
Cleanup Resource IO (#11364)
Refactorings to rationalize and simplify how we do IO with resources internally by introducing the IOResources helper.

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-03-28 11:08:44 +01:00
Jan Bartel 2fc7ad87d8
Reintroduce Cross Context Dispatch in Jetty 12 (#11451)
Re-introduce some support for cross context dispatch
2024-03-25 18:44:44 +01:00
Greg Wilkins 51fc906d37
Optimized ReservedThreadExecutor with ThreadIdPool (#11498)
* Introduced ThreadIdPool and replaced ThreadLocal with it
 * Modified ReservedThreadExecutor to be backed by a ThreadIdPool of semaphores

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: gregw <gregw@webtide.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2024-03-21 16:53:14 +01:00
Greg Wilkins c05ae3bb83
Implemented addBeanFromConstructor (#11319)
Added mechanism to safely add beans from a super constructor of ContainerLifeCycle


Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-03-13 17:52:55 +01:00
Joakim Erdfelt 18b2a7c201
Updating to version 12.0.8-SNAPSHOT 2024-02-29 16:00:27 -06:00
Joakim Erdfelt c89aca8fd3
Updating to version 12.0.7 2024-02-29 15:18:56 -06:00
Joakim Erdfelt 98ceb73cc6
Issue #11387: Reintroduce MultiPartCompliance.LEGACY in ee9/ee8 (#11388)
* Issue #11387: Reintroduce MultiPartCompliance.LEGACY in ee9/ee8
* Correcting javadoc
* Updating MultiPartCaptureTest to ...
  * Test with MultiPartFormData.Parser and MultiPart.Parser
 * Enable all test cases
    * base64 behaviors modified to not auto-decode base64 content
    * forms submitted without `_charset_` part (some using a different
       charset than UTF-8, like `Shift_JIS`)
* Fixing checkstyle warning
* Re-enable Part-ContainsContents expectations
* Rename MultiPartCompliance.NO_CRLF_AFTER_PREAMBLE to WHITESPACE_BEFORE_BOUNDARY to fit spec better
* Make ee9/ee8 legacy parser use legacy tokenization
* Testing ee9/ee8 legacy parser base64 auto-decoding behaviors
* Cleanup jetty-test-multipart class naming
* Adding ee10 tests against raw multipart examples
* Adding shorter whitespace multipart test
* Adding jetty-core version of failing ee10 tests
* Fixed missed notification for CR content in case of 1 chunk ending with CR and the next chunk ending with LF.
* Removed internal unused class MultiPartParser.
* Adding MultiPartCompliance.Violation events
  + in MultiPart.Parser
  + in MultiPartFormData.Parser
* lenient mode behavior
* new name fits violation better
+ adding violation to MultiPart.Parser.parseHeaderStart
* some simple cleanup of new ee9 code

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-27 15:09:26 -06:00
Greg Wilkins f07d812698
Fix #11414 URI schema and port normalization (#11416)
* Issue #11414 - use HttpURI instead of URIUtil to have a single point of spec behavior

* Issue #11414 - enforce lowercase scheme in HttpConfiguration.secureScheme

* Issue #11414 - Scheme produced on `Location` header is lowercase

* Issue #11414 - Scheme to lowercase

* Issue #11414 - Scheme to lowercase

* Revert change to HttpClient

* Added schema port knowledge to URIUtil

* Fixed tests for normalized URIs

* updates from review

* updates from review

* Fix tests

* Restored methods as deprecated

* More testing

---------

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-02-20 20:12:55 +01:00
Greg Wilkins 08174a3042
Fix #11401 StringBuilder rather than StringBuffer (#11406) 2024-02-19 14:52:17 +00:00
Joakim Erdfelt 4511d5e4a5
Making FormFields get defaults from Context, not Request. 2024-02-07 11:59:38 -06:00
Joakim Erdfelt 82d9177f0c
Updating to version 12.0.7-SNAPSHOT 2024-01-29 21:04:51 -06:00
Joakim Erdfelt 78ab6e6ba1
Updating to version 12.0.6 2024-01-29 20:42:49 -06:00
Ludovic Orban 58eaa5f45a Merge remote-tracking branch 'origin/jetty-11.0.x' into fix/jetty-12.0.x-11349-merge-from-11 2024-01-29 22:06:32 +01:00
Joakim Erdfelt 3853628074
Issue #11253 - Cleanup ComplianceViolation behavior to allow Cookie / URI / MultiPart compliance to also receive listener events. (#11254)
+ Introduce new events on `ComplianceViolation.Listener`
+ Introduce new `ComplianceViolation.Listener.initialize()` to allow for a new Listener at the appropriate time (to support per-request listeners)
+ Introduce new `ComplianceViolation.CapturingListener`
+ Introduce new `HttpConfiguration.(add/remove/get)ComplianceViolationListener()` methods.
+ Deprecate/Remove handling of `recordComplianceViolations` in `HttpConnection` and `HttpConnectionFactory` classes.
+ Produce warnings if use of `ComplianceViolation.Listener` as beans is still present.
+ Add `ComplianceViolation.Listener` support to `UriCompliance` locations.
+ Add `ComplianceViolation.Listener` support to `MultiPartCompliance` locations.
+ Add `ComplianceViolation.Listener` support to `CookieCompliance` locations.
+ Add `ComplianceViolation.Listener` support to `HttpCompliance` locations in HTTP/2 and HTTP/3

---------

Co-authored-by: gregw <gregw@webtide.com>
2024-01-24 08:24:05 -06:00
Joakim Erdfelt 96eea590ee
Updating to version 12.0.6-SNAPSHOT 2023-12-18 08:25:22 -06:00
Joakim Erdfelt 3aed62e495
Updating to version 12.0.5 2023-12-18 08:05:54 -06:00
Simone Bordet c5e40f5d90 Implemented server-side reset of the stream using error code NO_ERROR in case the request content is not read.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-15 18:23:06 +01:00
Greg Wilkins f776d3e4fb
Issue #10933 - Fix AsyncIOServlet test issues (#10949)
* Call ServletChannelState.asyncFailure from error listener. Fix #10933
* Separate invokers for read side and write side
* document async error issues
* updates from review
* updates from review
2023-12-15 10:34:03 +11:00
Greg Wilkins b0d259118c
Fixes #10956 - Reviewed Expect 100 Continue Handler (#10957)
Removed duplicate handling from servlet. Now only handled in core in HttpChannelState and protected it from concurrent writes.
Added additional tests.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-12 16:01:11 +01:00
Greg Wilkins 71354331e5
Issue #11014 - Cleanup of relative redirect handling Jetty-12 (#11019)
* Cleanup of relative redirect handling #11014
+ Handle request relative redirects
+ Moved to Response
+ Changed default to allow relative
* Updates to javadoc
2023-12-07 07:14:11 +11:00
Joakim Erdfelt 8597033339
Updating to version 12.0.5-SNAPSHOT 2023-11-30 13:33:03 -06:00
Joakim Erdfelt 9b415c6424
Updating to version 12.0.4 2023-11-30 13:14:15 -06:00
Greg Wilkins 41382b4e0e
Fix null host when checking virtual host #10922 (#10923)
Use the `Request.getServerName` static and check for null host.
2023-11-29 11:25:00 +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
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
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 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
Greg Wilkins 14152c425b
Better handling of Objects in JMX MetaData (#10762)
* Send attributes as Map<String,String>
* JMX-annotated ErrorHandler, fixed usage of showMessageInTitle and removed showServlet.
* JMX-annotated Request.Handler.
* Added JMX test module to test improvements to JMX.

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-24 10:03:28 +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
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
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
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
Greg Wilkins 57b953be67
Reintroduce an Exception type for invalid UTF-8 (#10553)
Introduce `Utf8CharacterCodingException`  and `Utf8IllegalArgumentException` as a substitutes for the removed `Utf8Appendable.NotUtf8Exception`.

* Updates from review
2023-09-22 12:24:42 +10:00
Jan Bartel 9bfa5cc65e
Issue #10463 Fix lastModified header when using HttpServletResponseWrapper (#10556)
* Issue #10463 Fix lastModified header when using HttpServletResponseWrapper
2023-09-21 05:49:54 +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
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
Joakim Erdfelt a415da73df
Merge remote-tracking branch 'origin/jetty-11.0.x' into fix/12.0.x/merge-from-11 2023-08-31 16:06:14 -05: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
Greg Wilkins e3ee84a5ad
Fix #10416 Do not copy ee9 response headers (#10417)
Use the core response HttpFields directly as the ee9 response headers to avoid copy and retain persistent field behaviour.
Fix #10416 EE9 Response headers
Added EE9 test to show that Persistent fields can be modified
Updated fix for #10339 so that persistent fields revert to original values after a clear operation
2023-08-29 08:31:02 +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
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
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
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
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
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
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
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
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
Greg Wilkins ba664769f3
Fix/jetty 12 code ql cleanups (#10078)
Exact long to int conversion.
2023-07-07 09:17:39 +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 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
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
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 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
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
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 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
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
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
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
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
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 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