Commit Graph

1009 Commits

Author SHA1 Message Date
Joakim Erdfelt 4f72b84c59
Cleanup ee9 DefaultServletTest
+ Fix various warnings
+ Disable ODD_JAR / extraClassPath (temporarily)
+ Reenable disabled test Test
+ Reenable disabled test testListingContextBreakout
2024-06-19 10:21:48 -05:00
Ludovic Orban 9546b3ab49
Fix missing notifyRemoteAsyncErrors http config wiring (#11897)
Fixed missing notifyRemoteAsyncErrors http config wiring and add tests

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-06-18 20:00:04 +02:00
Lachlan Roberts 6278ad8f77 PR #11907 - add newlines to end of openid .mod files
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-06-12 12:18:04 +10:00
Lachlan Roberts bc24f87303 Fix openid.mod files for Jetty 12
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-06-12 01:11:03 +10:00
Joakim Erdfelt f653c2f658
Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.1.x 2024-06-04 10:48:58 -05:00
Olivier Lamy fb1697fd07
Updating to version 12.0.11-SNAPSHOT 2024-05-30 15:23:16 +10:00
Olivier Lamy 26106dfc84
Updating to version 12.0.10 2024-05-30 14:39:40 +10:00
Jan Bartel 5dc9a73970
Jetty 12.1.x move demos (#11836)
* Refactor all ee demos to remove duplicates
2024-05-28 07:59:10 +02:00
Jan Bartel 810eccaeea Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.1.x 2024-05-28 10:23:00 +10:00
Greg Wilkins 042582813f
Fix #9177 dump JVM info (#11845)
Fix #9177 dump info from Runtime, Jetty.VERSION and System.getProperties
2024-05-28 10:14:48 +10:00
Simone Bordet e782f91ef2 Fixes #1470 - Replace Timer use with Jetty Scheduler.
Removed usages of the Timer class.

Deprecated TimerScheduler.

Code cleanup in ee10 classes.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-05-27 22:38:17 +02:00
Simone Bordet 65a016d1aa Fixes #11778 - jetty-http-spi does not properly provide SPI for modules.
Fixed all module-info.java files that did not have a "provides" declaration but had META-INF/services files.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-05-27 11:05:48 +02:00
Simone Bordet be7491e13a Sometimes it happens that some process is listening to `connector.getLocalPort() + 1`, making this test fail.
Now using a non-allocated privileged port from IANA, that nobody should listen to, so the test should not fail.
It is not a 100% guarantee, but perhaps better than before, especially because now a port < 1024 is used.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-05-23 22:06:46 +02:00
Simone Bordet 36cdc12ab7 Fixed JPMS declarations.
Some require transitive was missing, and has been added.
In other cases, making a field private (e.g. for log instances) made the warning go away.
In another case, removed explicit dependency on websocket core exception, as it was not necessary.

Clean up the POMs for jetty-eeN-annotations, that had unnecessary dependencies.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-05-23 22:06:01 +02:00
Greg Wilkins 456fd8020a
removed unused resources (#11830) 2024-05-23 14:48:32 +10:00
gregw f684b69977 Merge branch 'jetty-12.0.x' into jetty-12.1.x 2024-05-22 15:42:00 +10:00
Greg Wilkins 1b82757854
Fix Deprecated ClassMatcher #11767 (#11769)
Fix #11767 by making deprecated ClassMatcher class wrap the util ClassMatcher

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-05-21 10:42:33 +10:00
Simone Bordet ac47ae8d22
Merged branch 'jetty-12.0.x' into 'jetty-12.1.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-05-20 22:58:06 +02:00
Greg Wilkins 4c1c6a2652
Implemented servlet 6.1 redirect with content (#11743)
* Implemented servlet 6.1 redirect with content

Added option for server to generate a short html redirect body content, as per RFC9110 (default false)
Allowed an aggregated servlet response content to be used if clear is false.

* Redirect is a noop in include

* Fixed init order

This style of extensibility (calling virtuals from constructors) is very fragile.

* Update javadoc from review

Also update EE10 to also noop included response methods

* Update javadoc from review

Also update EE10 to also noop included response methods

* Update javadoc from review

Also update EE10 to also noop included response methods

* Update jetty-ee11/jetty-ee11-servlet/src/main/java/org/eclipse/jetty/ee11/servlet/ServletApiResponse.java

Co-authored-by: Jan Bartel <janb@webtide.com>

* Updating ee11 jsp-impl to 11.0.0-M19

* Updates from review

* updates from review

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

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

---------

Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-05-20 23:20:24 +10:00
Ludovic Orban c97c995642
Don't create circular throwables and don't throw StackOverflowError if one gets logged (#11793)
#11792 detect loops in throwables to avoid StackOverflowError

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-05-17 11:39:01 +02:00
gregw 22ddb6db77 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.1.x 2024-05-16 17:28:29 +10:00
Jan Bartel 7f1823e689 Fix untranslatable static var name. 2024-05-16 14:26:31 +10:00
Jan Bartel 6f2f599b17
Issue #11761 fix jetty maven doco and integration test (#11771)
* Issue #11761 fix jetty maven doco and integration test
2024-05-13 01:44:13 +02:00
Joakim Erdfelt 7f9312fe20
Issue #11766 - null out ReadListener on recycle to aid GC. 2024-05-10 10:27:10 +00:00
Jan Bartel 1e0f012f66
Support jetty-eeX-env.xml, as per jetty-eeX-web.xml (#11752)
* Support jetty-eeX-env.xml, as per jetty-eeX-web.xml

---------

Co-authored-by: Greg Wilkins <gregw@webtide.com>
2024-05-10 08:43:48 +02:00
Jan Bartel 0346b0619f
Issue #11760 fix NPE getRequestURL() for cross context (#11770)
* Issue #11760 fix NPE getRequestURL() for cross context

---------

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-05-10 08:34:43 +02:00
Joakim Erdfelt 3632a57f27
Merge branch 'release/12.0.9' into jetty-12.0.x 2024-05-07 14:23:44 -02:00
Lachlan Roberts 932c03bcab Issue #11748 - fix in PathMappings for websocket pathParam matching
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-05-06 16:41:03 +10:00
Jan Bartel 795b06c049 Fix IJ license header stuffup 2024-05-04 11:08:08 +10:00
Jan Bartel 4bbffa1c15
Jetty 12.1.x jetty ee web xml (#11746)
* Resolve jetty-eeX-web.xml before jetty-web.xml
2024-05-04 02:33:51 +02:00
Joakim Erdfelt 8e7e42201a
Updating to version 12.0.10-SNAPSHOT 2024-05-03 09:28:36 -04:00
Joakim Erdfelt efe8023327
Updating to version 12.0.9 2024-05-03 09:02:37 -04:00
Olivier Lamy cea1440079
install up to test scope
Signed-off-by: Olivier Lamy <olamy@apache.org>
2024-05-03 15:53:52 +10:00
Olivier Lamy d06a45b0c0
fix invoker settings xml for jetty-runner modules
Signed-off-by: Olivier Lamy <olamy@apache.org>
2024-05-03 14:12:11 +10:00
Jan Bartel ce13b8590f Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.1.x 2024-05-03 12:18:49 +10:00
Jan Bartel b11d1cb27f
Issue #11709 fix jetty-with-custom-class.xml file and use it (#11716)
* Issue #11709 fix jetty-with-custom-class.xml file and use it
2024-05-03 04:14:46 +02:00
Simone Bordet c5b2533fde
Fixed XML files after #11722.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-05-02 18:14:50 +02:00
Simone Bordet 42ba415318
Addendum to #11566. (#11722)
* Addendum to #11566.

Restored methods that were removed in WebAppClassLoader.Context.

Fixed method signatures for deprecated method -- they must take the deprecated ClassMatcher, not the newly introduced one.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-05-02 17:40:49 +02:00
Ludovic Orban 45e474b7d5
Improve ThreadLimitHandler (#11723)
* Improve ThreadLimitHandler

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-05-02 12:09:29 +02:00
Jan Bartel 53bb51a69d Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.1.x 2024-05-01 15:27:49 +10:00
Jan Bartel 7a47c76ecb
Issue #11706 ee9 BadServletInit in wrong package (#11713) 2024-04-30 03:55:26 +02:00
gregw b11996a3c4 Introduced EE11 and jetty-12.1.x 2024-04-26 22:42:57 +10:00
Jan Bartel e9c71be811
Jetty 12.0.x refactor common maven plugin classes (#11651)
* Issue #11514 - Cleanup `jetty.webapp.addServerClasses` property behavior for ee10/ee9/ee8

* Merging patterns (default -> env -> config)
* Moved ClassMatcher to util
* System Server Classes
* Renaming to Hidden/Protected
* Updated for loss of dump.war
* Update jetty-core/jetty-ee/src/main/java/org/eclipse/jetty/ee/WebappClassLoading.java
* fixed OSGi tests
* Ensure default hidden server and system classes.
* Fixed ee9 OSGi to load jetty-ee
* Adding more deprecations
* Changing XML demos/tests to use new getter names
* rollback xml changes in ee9/ee8
* Fix ee8 maven plugin
* Make jetty-maven dependency optional in ee9 to match ee10

---------

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: gregw <gregw@webtide.com>
2024-04-25 20:53:40 -05: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
Ludovic Orban 656e904d91
Fix buffer leak in `HttpClientStreamTest.testUploadWithConcurrentServerCloseClosesStream()` (#10431)
Fix buffer leak in HTTP and FCGI when the server is being shut down while there are in-flight requests

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-04-22 16:15:58 +02:00
Olivier Lamy d2beb2bd3f
Issue #9487 Upgrade to Infinispan 15 (#11503)
* upgrade to final release of infinispan 15

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2024-04-22 10:28:00 +02:00
Greg Wilkins 33feac33e7
Revert "Revert NON_POOLING change" (#11649)
This reverts commit 2bf7d6cecc.
2024-04-18 15:52:03 +10:00
Ludovic Orban d8b910c843 fix activation pattern
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-04-17 10:31:30 +02:00
Ludovic Orban 08223be155 update to use the finalized foreign api of JDK 22
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-04-17 10:31:30 +02:00
Olivier Lamy ea8139e94a
Issue #11642 restore Jetty ee8 runner (#11650)
* Issue #11642 restore Jetty ee8 runner
---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2024-04-13 10:33:30 +02:00
Greg Wilkins 30bee710f1
Move ClassMatcher to core to have a consistent fix for addServerClasses in all environments (#11566)
* Issue #11514 - Cleanup `jetty.webapp.addServerClasses` property behavior for ee10/ee9/ee8

* Fix test

* Merging patterns (default -> env -> config)

* Moved ClassMatcher to util

* Adding more deprecations

* Changing XML demos/tests to use new getter names

* rollback xml changes in ee9/ee8

---------

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
2024-04-12 17:31:47 +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
Joakim Erdfelt 58293ad1f1
Update Dependencies [12.0.x] - March 2024 (#11591)
* Bump jetty-setuid-jna
* Updating dependencies
* Updating dependencies in jetty-ee10-annotations
* Updating dependencies in jetty-ee10-plus
* Fix jetty-ee8-osgi-boot deps
* Fix jetty-ee9-osgi-boot deps
* Address osgi duplicate resource plugin
2024-03-29 12:23:22 -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
Simone Bordet e00a71a00f
Fixes #11583 - Broken HTTP/3 tests (#11584)
Initialized PEM directories for both client and server.
Added [lib] section that was missing due to #11263.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-03-27 22:37:33 +01:00
Joakim Erdfelt 5743193448
Disable flaky test - see https://github.com/jetty/jetty.project/issues/11581 2024-03-27 10:18:48 -05:00
Joakim Erdfelt 05aa1e1b08
Issue #11495 - Add UriCompliance rules that follow the HTTP / URI / Servlet specs for illegal & suspicious characters (#11496)
* Issue #11495 - Add UriCompliance rules that follow the HTTP / URI / Servlet specs for illegal & suspicious characters
* more illegalPathCharacterData test cases
* Correcting SUSPICIOUS_PATH_CHARACTERS semantic (encoded and decoded)
* Check for illegal and suspicious characters as we are parsing the path.
* Only look for ambiguous paths if we know there are dots or encodings.

---------
Co-authored-by: gregw <gregw@webtide.com>
2024-03-27 09:28:30 -05:00
Joakim Erdfelt 121999bf7c
Issue #11539 restore old behavior of `Resource.copyTo()` with regards to existing destination files. (#11540)
* Issue #11539 restore old behavior of Resource.copyTo()
* Do not delete destination resource
  if it exists before copy to restore
  the behavior to what we had in
  Jetty 9/10/11.
* Formalizing IO.resolvePath()
2024-03-27 07:38:00 -05:00
Jan Bartel 94beede357
Issue #11574 war should not be extracted unless configured to do so (#11575)
* Issue #11574 war should not be extracted unless configured to do so
2024-03-27 10:02:16 +01:00
Lachlan 028221e343
Ensure request is set for ContextScopeListener in EE10 (#11518)
* Ensure request is set for ContextScopeListener in EE10
2024-03-25 19:18:00 +01:00
Jan Bartel cfa1bd9b51
Remove old dump.war from WebAppContextTest and replace by generated war. (#11561)
* Remove old dump.war from WebAppContextTest and replace by generated war.
2024-03-25 19:16:02 +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
Jan Bartel 2aa93575e7
Issue #11558 Ensure jetty created webapp tmpdir fresh each start (#11559)
* Issue #11558 Ensure jetty created webapp tmpdir fresh each start
2024-03-25 17:13:35 +01:00
Greg Wilkins 6529fb2430
Fix #11553 restore startWebapp (#11554)
Fix #11553 restore startWebapp to allow interception of the start sequence after MetaData.resolve
2024-03-22 10:41:14 +00: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 3d49cd3b3c
Allow resolve to return non-existent resources (#11476)
Fix #11411 by allowing non-existent resources to be returned from resolve
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2024-03-21 12:49:50 +00:00
Joakim Erdfelt c8ea569e5d
Fixing missing dep of testcontainers -> commons-compress -> commons-codec (#11530)
* Fixing missing dep of testcontainers -> commons-compress -> commons-codec

* More commons-codec fixes
2024-03-19 13:11:28 -05:00
Simone Bordet 763999d08a
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-03-19 11:43:29 +01:00
Joakim Erdfelt d07d13f30a
Merge pull request #11511 from jetty/fix/12.0.x/classmatcher-match-npe
Issue #11510 - Prevent NPE in ClassMatcher.match()
2024-03-13 13:47:29 -05: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 c2d0ab29dc
Issue #11510 - Prevent NPE in ClassMatcher.match() 2024-03-12 17:00:15 -05: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
Jan Bartel 313def717c Issue #11463 Fix flaky session tests 2024-02-29 20:07:22 +01:00
Joakim Erdfelt 1bba3cd41e
Merge pull request #11455 from jetty/fix/12.0.x/webinfconfig.unpack.protection
Improve DEBUG during WebInfConfiguration.unpack
2024-02-28 04:17:38 -08: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
Joakim Erdfelt 54aaa3a398
Improve DEBUG during WebInfConfiguration.unpack 2024-02-27 10:15:24 -06:00
Simone Bordet 24c1140917
Fixes #8979 - Jetty 12 - HttpClientTransport network "modes". (#11368)
* Introduced oej.io.Transport as the abstraction for the low-level transport of high-level protocols.
Now protocols such as HTTP/1.1 or HTTP/2 can be transported over TCP, QUIC, Unix-Domain, memory, and possibly over other low-level custom protocols too.
* Introduced oej.client.Request.transport(Transport) to specify Transport for each request.
* Introduced Transport to [HTTP2Client|HTTP3Client].connect(...) methods.
* Introduced [Client|Server]QuicConfiguration so that it can be used in other Connectors such as MemoryConnector.
* Introduced oej.server.MemoryConnector and EndPoint.Pipe for memory communication between peers, along with a MemoryTransport.
* Introduced QuicTransport as a wrapper for other Transports, so that QUIC can now also be transported over memory.
* Improved javadocs and documentation.
* Removed usage of ClientConnector.forUnixDomain() from FastCGIProxyServlet (ee10 and ee9).
* Replaced usage of HTTP3ServerConnector with QuicServerConnector in jetty-http3.xml.
* Fixed handling of Instruction notifications in case of re-entrance.
Now first clear the list, then notify to avoid that when re-entering the same instruction is notified multiple times.
* Introduced ContentSourceRequestContent, and updated ProxyHandler to use it.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-26 17:24:24 +01:00
Jan Bartel a1cb4750d7
Jetty 12.0.x 11377 fix jettyhome osgi path (#11418)
* Issue #11377 fix jettyhome osgi path and  WebInfConfiguration.unpack for windows
2024-02-26 12:07:10 +01:00
Joakim Erdfelt bfac61cd89
Issue #11424 - Document default of `jetty.deploy.scanInterval` at `0` (#11437)
+ Update documentation and defaults in mod files
2024-02-22 14:25:01 -06:00
Danish Nawab f8601750f3
Fixes #11353 named virtual thread executor (#11430)
Introduced `VirtualThreads.getNamedVirtualThreadsExecutor(String namePrefix)` to allow users/libraries to name virtual threads if they so wish.
2024-02-21 21:38:58 +01: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
Simone Bordet a33dd59b21 Fixes #11339 - Content-type additional parameters.
Fixed handling of Content-Type in FormFields.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-01-29 15:07:41 +01:00
Simone Bordet 4e28331595
Fixes #11095 - IllegalStateException for completed requests with GzipHandler (#11210)
* In ServletChannel, in COMPLETE state, there was a check comparing the number of bytes written with that declared by Content-Length.
Unfortunately the check was wrong in case of gzip, because it was comparing the application length with the gzipped length, resulting in a late sendErrorOrAbort() that was an abort() because the response was already fully sent.
Furthermore, if sendErrorOrAbort() was actually an abort(), there was an unnecessary attempt to complete the output.
* In GzipHandlerResponseAndCallback there were 2 last writes: one when the application calls output.close(), and one when the callback is succeeded.
Furthermore, when no content needs to be written, it was still compressed, causing an IOException in ChannelResponse (again when double-checking the bytes written, since Content-Length was 0, but the gzip header and trailer were written).
* Updates semantic of when to add the "Vary" header.
Now it is always only added by GzipHandler, when it would be possible to generate a response that might be compressed (even if it will not).
* Added *.bz2 mime-type.
Updated GzipHandler with the correct mime-type for *.bz2: application/x-bzip2.
* Improved checks for the number of bytes written against declared content-length.
This is necessary because welcome files are written by DefaultServlet (most of the times) bypassing the Servlet classes, using ServletContextResponse directly.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-01-27 10:50:30 +01:00
Joakim Erdfelt 6c79f8f8fb
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2024-01-25 14:42:37 -06:00
Joakim Erdfelt fe99538ab8
Merge pull request #11314 from jetty/fix/12.0.x/ee10-defaultservlet-deprecated-init-params
Issue #11312 - fix deprecated init-param detection in DefaultServlet
2024-01-25 07:51:06 -06:00
Ludovic Orban 7fbd51a952
Restore DefaultServlet.doPost to the previous major releases' behavior (#11300)
#11299 restore DefaultServlet.doPost to the previous major releases' behavior

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-01-24 21:53:30 +01:00
Joakim Erdfelt 6e1ae84fde
Issue #11312 - fix deprecated init-param detection in DefaultServlet 2024-01-24 09:20:44 -06: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 8368deea7e
Issue #11263 - Reduce usage of glob lib/foo/*.jar in modules (#11264)
* Using @foo.version@ technique and proper
  lib lists to allow arbitrary version
  updates from properties
* Fix spotless
* Remove duplicate entries
* Only replace System property "jetty.version" with manifest-ver if blank/null
* Fixing bad module definitions
2024-01-16 10:46:58 -06:00
Simone Bordet 581f9ae9f4
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-01-08 10:19:20 +01:00
Simone Bordet 356f400d2e
Removed leftover System.err from tests.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-01-07 13:27:13 +01:00
Lachlan Roberts 37a296dfdc Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x-11081-websocketRace 2023-12-20 12:12:13 +11: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
Lachlan 62210d39c2
add deployment exception for non Jakarta WebSocket endpoints used in ServerEndpointConfig (#11032)
* Issue #11009 - add test for bad Jakarta endpoint
* Issue #11009 - ensure endpoint deployable before adding ServerEndpointConfig
* add same test and fix for ee9

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-12-17 13:37:10 +01: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
Joakim Erdfelt de5dffef39
Merge pull request #11070 from jetty/fix/12.0.x/ee8-ee9-nested-handler-impl-testing
Add Testcase for ee8/ee9 nested HandlerCollection
2023-12-15 11:13:48 -06:00
Joakim Erdfelt 499c71dec5
Add missing license header on new testcase 2023-12-15 08:28:46 -06:00
Joakim Erdfelt 13d9277fa1
Add Testcase for ee8/ee9 nested HandlerCollection 2023-12-15 08:21:01 -06:00
Simone Bordet eb1e9eb8c4
Fixes #11016 - Jetty 12 IllegalStateException when stopping Server wi… (#11017)
* Made ServletChannel error handling more robust.
A failure in error handling is now remembered so that the Handler callback can be failed later.
* Avoid failing the Handler callback from ServletChannel.abort(), as it is too early: should be failed when processing the TERMINATED state, similarly to when it is succeeded.
* Removed dead code from HttpConnection.SendCallback.reset(), since response is always non-null.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-15 15:09:20 +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
Simone Bordet 3681d771da
Fixes #10945 - Flaky test ServletTest.testSimpleIdleRead (#11063)
Increased idle timeout durations, as 250ms is too short for CI, in both ee9 and ee10.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-14 19:25:54 +01:00
Joakim Erdfelt f96b0d5817
Merge pull request #11052 from jetty/jetty-12.0.x-11046-jasper-10.0.27
Issue #11046 Update EE9 to Apache Jasper 10.0.27
2023-12-13 14:36:05 -06:00
Jan Bartel d926380651
Refactor eeX plus.security and plus.annotation classes to core (#11030)
* Refactor eeX plus.security and plus.annotation classes to core
2023-12-13 06:34:55 +01:00
Jan Bartel 3c155c22bb Issue #11046 Update EE9 to Apache Jasper 10.0.27 2023-12-13 16:24:11 +11:00
Jan Bartel 854bf2e0ee Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-12-13 16:14:48 +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
Joakim Erdfelt f6f031ee96
Use jetty-home/etc/webdefault-ee#.xml instead 2023-12-08 07:18:51 -06:00
Joakim Erdfelt 5dbd14efd0
Merge remote-tracking branch 'origin/jetty-12.0.x' into fix/12.0.x/properties-update 2023-12-07 13:13:28 -06:00
Joakim Erdfelt 271b1ee2df
Merge remote-tracking branch 'jetty-11.0.x' into jetty-12.0.x 2023-12-06 15:21:13 -06:00
Joakim Erdfelt 19a8b05daa
Deprecate `jetty.deploy.defaultsDescriptor` in favor of replacement `jetty.deploy.defaultsDescriptorPath` 2023-12-06 14:15:49 -06: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 92c710f3fb
Deprecate `jetty.openid.authMethod` in favor of replacement `jetty.openid.authenticationMethod` 2023-12-06 14:10:07 -06:00
Jan Bartel fd1c1e3c9b
Refactor JNDI across environments for common JNDI components that can be in core (#10897)
* Refactor jndi and plus to extract ee agnostic classes to jetty-core
2023-12-05 23:48:20 +01: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
Jan Bartel 02c0782a04 Issue #10942 Fix flakey IdleSessionTest 2023-11-30 18:09:18 +01:00
Simone Bordet 82fbf3d4e9
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-29 13:54:49 +01:00
Simone Bordet d166056f18
Fixes #10384 - ServletChannel now using proper state changes for calls to ErrorHandler to avoid IllegalStateExceptions (#10930)
Reworked the ServletChannel.handle() SEND_ERROR case.
Now using the proper state changes to call ErrorHandler.handle(), which is asynchronous, so that IllegalStateExceptions are avoided.

Restored idle timeout tests in ee9/ee10 AsyncMiddleManServletTest.

Fixed notification of request destroyed in ErrorHandler: must be before completing the callback, since listener may call Servlet APIs that should see the ServletChannel state before the ErrorHandler callback changes it.
Updated ServletChannelState.isAsync() and isAsyncStarted().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-29 09:19:04 +01:00
Jan Bartel df42cb276d
Improve Resource use in MetaInfConfiguration (#10889)
* Reduce resources kept open by MetaInfConfiguration
---------

Co-authored-by: Greg Wilkins <gregw@webtide.com>
2023-11-29 02:11:47 +01: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
Ludovic Orban 5a273f0d3e
Align Core, ee9 and ee10 `AbstractTest` and fix ee9 H3 tests (#10929)
* #10386 Align core, ee9 and ee10 AbstractTest:
 - use the same temporary folder technique
 - configure the SSL contexts the same way

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-27 17:14:31 +01:00
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 4b0f45f121 warn on duplicate container resource for ee9
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-11-17 16:11:10 +11: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 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
Olivier Lamy 8ba5ff1e9c
Issue #10688 add Jetty 12.0.x ee8 osgi (#10711)
* Add OSGi for ee8 environment

Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-10-26 20:23:52 -05:00