Commit Graph

1187 Commits

Author SHA1 Message Date
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
gregw b11996a3c4 Introduced EE11 and jetty-12.1.x 2024-04-26 22:42:57 +10:00
Jan Bartel 151fffb48e Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.1.x 2024-04-26 16:50:05 +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 91633359c3
Issue #11699 - ISE when Response does not exist. 2024-04-25 10:13:46 -05:00
Jan Bartel 23ca73e833
Issue #11677 fix AttributeNameTest (#11689) 2024-04-24 08:42:53 -05:00
Jan Bartel aef8cb1b50
Issue #11676 fix session CreationTest (#11685) 2024-04-24 08:42:29 -05:00
Ludovic Orban bb633b8a0f
Fix `HttpFields.Mutable.Wrapper.computeField()` (#11688)
* #11687 make HttpFields.Mutable.Wrapper.computeField() call onRemoveField() and remove the field when null is returned by computeFn
* #11687 replace IAE with NPE
* #11687 replace collect(Collectors.toList()) with toList()

---------

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-04-23 18:13:01 -05:00
gregw a8ffebff2b Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.1.x 2024-04-24 09:02:13 +10:00
Joakim Erdfelt ebe1b0e4cc
Merge pull request #11684 from jetty/fix/12.0.x/asynccontexttest-improvements
Cleaning up ee10 `AsyncContextTest`
2024-04-23 13:37:16 -05:00
Ludovic Orban a1450f5cf7
Fix for some invalid server behaviors when a client is aborting a request (#11637)
* #11631 abort instead of rethrow when the exception handler in handle() throws an exception
* fix ee10 state machine error when client aborts
* H3: wire client-sent reset packet on abort
* H3: only fail finished streams when fill interested is false

---------

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-04-23 08:30:21 -05:00
gregw 758543d7f0 updates from review 2024-04-23 18:10:34 +10:00
gregw 2223170c4f Merge branch 'jetty-12.0.x' into jetty-12.1.x
Signed-off-by: gregw <gregw@webtide.com>
2024-04-23 17:38:22 +10:00
Joakim Erdfelt a0f4e9809a
Cleaning up AsyncContextTest 2024-04-22 14:31:32 -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
Joakim Erdfelt 907f2001ff
Issue #11573 - add new `disable-urlcache.mod` (#11582)
* Issue #11573 - add new disable-urlcache.mod

* Issue #11573 - Adding new testcase

* Remove old tests

* Prevent overlapping unzip("jetty-home.jar") errors
2024-04-15 21:00:23 -05: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
gregw 765cdb20db Cleanup in preparation for creating EE11 2024-04-05 17:19:01 +02:00
gregw 9155a72190 updates from review 2024-04-04 23:06:06 +02:00
gregw 175b191bc9 updates from review 2024-04-04 23:01:57 +02:00
gregw aff96fe739 updates from review 2024-04-04 22:48:02 +02:00
gregw 627aaa3830 Merge branch 'jetty-12.0.x' into fix/12.0.x/addserverclasses-ee9-gw 2024-04-03 23:51:51 +02:00
Joakim Erdfelt ecb610aa5d
Merge remote-tracking branch 'origin/release/12.0.8' into jetty-12.0.x 2024-04-03 08:44:45 -05:00
Olivier Lamy 3a66e02053
Merge branch 'jetty-11.0.x' into jetty-12.0.x-merge-11 2024-04-02 19:51:51 +10:00
gregw 210b068bf9 minimal tests for defaults 2024-03-30 10:27:21 +01: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
Simone Bordet 1b05d49fd8
Allow configuring showCause in ErrorHandler (#11587)
Allows to suppress "caused by" in error message, not only the stacks traces.
ErrorHandler.showCause = false by default.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Dennis Hoersch <dennis.hoersch@springernature.com>
Co-authored-by: Dennis Hoersch <dhs3000+ghtu@posteo.de>
2024-03-29 16:37:56 +01:00
gregw 94c0cae726 fixed OSGi tests 2024-03-29 11:29:18 +01:00
gregw 19aad85e82 Merge branch 'jetty-12.0.x' into fix/12.0.x/addserverclasses-ee9-gw 2024-03-28 18:50:12 +01: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
Olivier Lamy ee82c2b761
Issue #10387 configure doclint to not generate verbose useless warning, remove obsolete parameter (#11544)
Signed-off-by: Olivier Lamy <olamy@apache.org>
2024-03-27 22:27:21 +01:00
gregw ce085027d2 renamed as per review 2024-03-27 17:35:01 +01: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
gregw 5bfc74f816 Updated for loss of dump.war 2024-03-26 20:12:06 +01:00
gregw 0ddab409eb Merge branch 'jetty-12.0.x' into fix/12.0.x/addserverclasses-ee9-gw
# Conflicts:
#	jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/WebAppContext.java
2024-03-26 18:21:14 +01:00
Joakim Erdfelt 9defd5d416
Issue #11548 - Replication as jetty-ee10-webapp testcase (#11550)
* Issue #11548 - Replication as jetty-ee10-webapp testcase
* Correct order of WebAppContext.stop

---------

Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: gregw <gregw@webtide.com>
2024-03-26 07:04:49 -05: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
gregw 01f2903cde System Server Classes
Renaming to Hidden/Protected
2024-03-25 13:26:47 +01:00
gregw 8b46ea20bc System Server Classes 2024-03-25 09:10:41 +01:00
gregw 17b20041ba System Server Classes 2024-03-24 19:47:41 +01:00
gregw 2775c3233d Moved ClassMatcher to util 2024-03-24 18:07:04 +01:00
gregw 403f59a586 Merge branch 'jetty-12.0.x' into fix/12.0.x/addserverclasses-ee9 2024-03-24 17:46:05 +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
Joakim Erdfelt 87d0c451c5
Merging patterns (default -> env -> config) 2024-03-13 13:45:15 -05:00
Joakim Erdfelt 503225e7a8
Fix test 2024-03-13 12:04:53 -05:00
Joakim Erdfelt c8c6dad752
Issue #11514 - Cleanup `jetty.webapp.addServerClasses` property behavior for ee10/ee9/ee8 2024-03-13 12:02:20 -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
Ludovic Orban 0a2382408f
Fix StatisticsHandler not receiving implicit status 200 (#11487)
#11482 introduce new onComplete event in EventsHandler and use it to record status in StatisticsHandler

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-03-13 17:30:33 +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
Greg Wilkins 4155e7bc25
Add suppressed failures in Callback failed (#11435)
If an exception is thrown during failure handling, then record the original failure as a suppressed Throwable on the thrown exception
2024-02-29 20:06:50 +01:00
Joakim Erdfelt 4aeec060ac
Fixing merge - removing double/nested hasViolations() check 2024-02-28 08:53:42 -06: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 97cb50ead9
Improve Error messages for Ambiguous URIs (#11457)
* Some testing of HttpURI for Issue #11448
* Issue #11448 - improved stacktrace message for ambiguous URI
2024-02-28 06:15: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
Joakim Erdfelt 54aaa3a398
Improve DEBUG during WebInfConfiguration.unpack 2024-02-27 10:15:24 -06:00
Joakim Erdfelt bb646ed085
Improve jetty-util on Windows (#11440)
* Improve jetty-util on Windows
* Enable ATOMIC_MOVE on Resource.copyTo()
* Add reference to Resource impl in exception.
* Attempting to address sneaky Windows path strings that look like URIs
* Deprecate URIUtil.correctFileURI in favor of new URIUtil.correctURI method
2024-02-27 06:32:44 -06:00
Lachlan 4f1401438a
Merge pull request #11433 from jetty/fix/jetty-12.0.x/11278-symlink-dir-listing
Issue #11278 - fix 500 response when trying to display symlinked directory
2024-02-27 17:10:55 +11:00
Simone Bordet 6facb0f7f5
Fixes #11370 - IllegalStateException when last write fails. (#11439)
Removed the call to `ServletChannel.abort()` from the write callback.

As the write was issued from `ServletChannel.handle()` case COMPLETE, it was eventually calling `ServletChannelState.completed(Throwable)`, which is expecting the requestState to be COMPLETING.
However, calling `abort()` would set the requestState to COMPLETED, causing the IllegalStateException.

There should be no need to call `abort()` from the callback of failed writes, since failing the various callbacks should be enough, eventually failing the `HttpStream`, which would take care of tearing down the connection (HTTP/1) or the stream (HTTP/2+).

Now aborting the response from ServletChannelState.completed(Throwable).
Fixed SizeLimitHandler exception message.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-26 17:27:20 +01: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
Lachlan Roberts 9234331d62 Issue #11278 - fix 500 response when trying to display symlinked directory
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-22 17:32:50 +11:00
Lachlan 33e00dc452
Merge pull request #11279 from jetty/jetty-12.0.x-11271-AliasCheckCombinedResource
Issue #11271 - fix use of AliasCheckers with CombinedResource
2024-02-22 08:48:54 +11:00
Ludovic Orban 509ede1d85
Add jersey test module (#11423)
Add jersey test module

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-21 22:00:07 +01: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
Ludovic Orban 3a6ad49271
Jetty 12: `ContextHandler.getTempDirectory()` does not respect the `Context.getTempDirectory()` contract (#11397)
#11396 fix ContextHandler.getTempDirectory() so it never returns null as the contract mandates

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-02-21 09:26:34 +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
Lachlan Roberts 87aeefbbc9 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-11271-AliasCheckCombinedResource 2024-02-15 23:48:40 +11: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
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
Lachlan Roberts c1e2d47968 fix bug in HotSwapHandler
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-25 15:00:45 +11:00
Lachlan Roberts 51cb410c7e revert changes to DefaultServletTest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-25 14:48:03 +11:00
Joakim Erdfelt b571c6a2d3
Issue #11292 - Missing Date Response Header. (#11293)
* Add Unit Tests for Date Response header
  in ee10 and Distribution
2024-01-24 18:23:19 -06: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
Jan Bartel 676d76c1ff
Issue #11280 update ee10 osgi embedded xml files (#11284)
* Issue #11280 update ee10 osgi embedded xml files and add test
2024-01-24 06:47:05 +01:00
Lachlan Roberts 4339474d44 cleanup
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-17 13:57:45 +11: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
Lachlan Roberts 874a02d1f9 cleanup
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-17 00:18:33 +11:00
Lachlan Roberts aaaf7aa67b fix alias checkers to allow use of CombinedResource
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-17 00:13:26 +11:00
Lachlan Roberts 02f583ef3d add testing for CombinedResource with AliasCheckers
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-16 22:27:25 +11:00
Simone Bordet a9e564ad8c
Fixes #10220 - Implement CrossOriginHandler. (#11093)
Introduced CrossOriginHandler.
Added cross-origin Jetty module.
Added CrossOriginHandler documentation to the programming guide.
Added CrossOriginHandler documentation to the operations guide.
Added cross-origin headers to the HttpHeader enum.
Added test cases.
Deprecated ee10 CrossOriginFilter.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-01-12 09:57:21 +01: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
Joakim Erdfelt 62e073c52c
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2024-01-03 14:08:11 -06: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
Lachlan 35af2d8984
Do not use HttpStream.Wrapper in SizeLimitHandler (#11051)
* Do not use HttpStream.Wrapper in SizeLimitHandler
* Updated the SizeLimitHandlerServletTest
* Udpated documentation and javadocs.

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-12-15 15:11:57 +01: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
Jan Bartel b3869ee5f8
Issue #11045 update Apache Jasper 10.1.16 (#11050) 2023-12-13 23:40:34 +01: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 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 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
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
Lachlan 876796d7ca
Issue #10926 - add support for CombinedResource in AttributeNormalizer (#10927)
* #10926 - skip existence check if only one Normalizer
* fix for AttributeNormalizer

---------

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: gregw <gregw@webtide.com>
2023-11-30 13:02:13 -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 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
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