Commit Graph

462 Commits

Author SHA1 Message Date
Simone Bordet 4225544222
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-07 19:34:43 +01:00
Joakim Erdfelt b3505ae687
Jetty 12 - General cleanup of URIUtil (#8861)
+ Removal of __CHARSET
+ Removal of unused methods
+ Using new switch/case concepts
+ cleanup of URIUtil constants
+ cleanup of URIUtil methods
+ collapse separate methods
+ simplify encodePath()
* Javadoc updates
* equalsIgnoreEncoding cleanup (no longer used by Resource layer)
2022-11-04 14:28:53 -05:00
Lachlan Roberts c0bb0272f7 fix release in CachingHttpContentFactory and always use ByteBufferPool
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-11-03 17:38:22 +11:00
Lachlan Roberts 6facedba75 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-HttpContent-Caching-Refactor 2022-11-02 17:28:42 +11:00
Lachlan Roberts e28a528165 changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-11-02 17:21:44 +11:00
Greg Wilkins 976ab3df8d
ResourceCollection should not have a path (#8711)
ResourceCollection should not have a path
Nor name, nor filename unless all resources agree on it.
revert combine and related methods to return Resource and not explicitly a ResourceCollection, as if there is only 1, then a collection is not needed
cleanup ResourceCollection creation. Avoid sanity checks on resolved resources.
2022-11-01 15:54:50 +11:00
Greg Wilkins 3b2d4048fd replaced getPathInContext with static method
updates from review
2022-10-25 21:11:10 +11:00
Greg Wilkins 9dc9eaa711 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12-static-pathInContext 2022-10-25 20:42:25 +11:00
Gili Tzabari 0724d1090d
Fixes #8723: Provide a thread-safe way to modify HttpClient proxies at runtime. 2022-10-25 10:23:04 +02:00
Lachlan Roberts 7752720861 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-HttpContent-Caching-Refactor 2022-10-25 16:44:53 +11:00
Lachlan Roberts 02e0a3993c cannot add ContentFactory to servletContext attribute as there may be multiple factories in a single context
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-25 16:39:42 +11:00
Greg Wilkins 6c9d34c26a Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12-static-pathInContext
# Conflicts:
#	jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/DefaultServlet.java
2022-10-25 09:11:40 +11:00
Simone Bordet 660093ff3a
Code cleanups.
Removed obsolete oej.server.HttpTransport.
Cleaned up ConnectionMetaData.Wrapper.
Simplified ee10 DefaultServlet.ServletCoreRequest.
Other minor cleanups.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-24 16:25:53 +02:00
Greg Wilkins 465ddf0932 WIP replacing getPathInContext with static method 2022-10-24 17:55:16 +11:00
Greg Wilkins 30401d8cf8 WIP replacing getPathInContext with static method 2022-10-24 11:26:50 +11:00
Greg Wilkins 1885df7e03 WIP replacing getPathInContext with static method 2022-10-23 22:36:15 +11:00
Ludovic Orban 38289e46d4
Make Client's Request and Response `abort()` fully async (#8725)
Changed Request and Response abort() to be fully async by returning a CompletableFuture<Boolean>

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-10-21 15:32:46 +02:00
Lachlan 30138e9d03
Merge pull request #8742 from eclipse/jetty-12.0.x-websocket-disabled-tests
Re-enable and fix websocket tests for Jetty 12 ee9 and ee10
2022-10-21 13:08:55 +11:00
Greg Wilkins ac6abb307d
ResourceHandler set base resource as string (#8735)
* ResourceHandler set base resource as string

* ResourceCollection should not have a path

fixed tests
2022-10-21 09:32:54 +11:00
Lachlan Roberts 0e1bae4059 use RetainableByteBuffer for getBuffer in HttpContent
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-20 21:29:55 +11:00
Lachlan Roberts 8768725de9 separate evicting logic from CachingHttpContentFactory
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-20 10:37:38 +11:00
Lachlan Roberts 86da43a54a improve configuration options for HttpContent.Factory
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-20 10:00:04 +11:00
Joakim Erdfelt 259deea2f7
Jetty 12 - Resource `resolve()` and `newResource()` return null on resources that do not exist (#8702)
* Resource `resolve()` and `newResource()` return null on resources that do not exist
* Introduce `Resources` utility methods and use them
* Updating javadoc
2022-10-19 15:50:37 -05:00
Joakim Erdfelt 9061348ec4
Jetty 12 - Simplification of aliases in `PathResource` (Take 2) (#8734)
* simplify the PathResource.resolveTargetPath code
* changes to how PathResource handles aliases
* fix usages of Resource.getTargetUri()
* fixes for FileSystemResourceTest
* update javadoc for Resource.getTargetURI()
* rename getTargetURI to getCanonicalURI
* let resolveCanonicalPath return null if resource does not exist
* add test in PathResourceTest for broken symlinks
* some changes from review + optimization for exists()
* restore name to getTargetUri in Resource
* fix some tests related to PathResource changes
* revert changes to PathResource equals and hashcode
* also compare URI in PathResource
* checkAlias to resolveAlias
* PathResource cleanup
+ Adding comments about class fields.
+ Removing normalization from
  input/output/comparison flows.
+ Collapsing `resolveTargetPath`
  into `resolveAlias` to react
  accordingly to the exceptions
  that can flow out of Path.toRealPath().
+ Failure on Path.toRealPath() is never
  an alias, as the resource cannot ever
  be served anyway.
+ More comments in `resolveAlias()`
+ Failed / Bad / Nonexistent / Inaccessible
  resources are not aliases to anything.
* Renames of targetPath/targetUri
  `targetPath` to `realPath`
  `targetURI` to `realURI`
* Cleanup alias/aliasResolved booleans
* More testcase cleanup around not-exist
* Don't resolve alias on Error during toRealPath
* Add test to check how Alias check behaves if non-existent resource exists later

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-19 11:17:23 -05:00
Lachlan Roberts ad7ae3cfc9 Rename all HttpContent factories
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-19 17:10:15 +11:00
Lachlan Roberts c85f3f40a3 fix all disabled tests in websocket ee9
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-19 16:55:47 +11:00
Simone Bordet 02a7f1cce1
Re-enabled distribution tests that were disabled. (#8722)
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-18 20:10:57 +02:00
Joakim Erdfelt ad406ac44c
Cleaning up test cases with eye on work/temp file management 2022-10-18 07:50:44 -05:00
Lachlan Roberts cccc16c03e Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-HttpContent-Caching-Refactor 2022-10-18 22:28:13 +11:00
Joakim Erdfelt 586d0fd097
Merge branch 'jetty-12.0.x' of github.com:eclipse/jetty.project into jetty-12.0.x 2022-10-17 18:32:35 -05:00
Joakim Erdfelt 3c5fb319ec
Fixing ee9 MetaInfConfigurationTest usage of classpath to be compatible with ee8 conversion. 2022-10-17 17:09:36 -05:00
Simone Bordet 0d0790834d
Moved FastCGIProxyServlet in ee9 to FastCGIProxyHandler in core. (#8718)
Moved FastCGIProxyServlet in ee9 to FastCGIProxyHandler in core.
Moved TryFilesFilter in ee9 to TryPathsHandler in core.
Update Jetty modules to properly setup the class-path in case of proxy usage.

Fixes Surefire configuration to run the tests.
The problem is that fcgi-proxy depends on fcgi-client, so both will be put on the module-path.
However, fcgi-server is used for the tests, it is in the class-path, but depends on fcgi-client that is on the module-path.
Therefore, when a fcgi-server class tries to access a fcgi-client class, JPMS throws because the fcgi-client module does not export to the unnamed module.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-18 00:00:34 +02:00
Joakim Erdfelt 65c5e93351
Fixing checkstyle 2022-10-17 15:33:14 -05:00
Joakim Erdfelt 00c06738f0
Use MavenPaths where appropriate (ee9 -> ee8 conversion helper) 2022-10-17 15:23:24 -05:00
Joakim Erdfelt 1b790d51b4
Use WebAppContext.getResourceFactory() 2022-10-17 15:20:15 -05:00
Joakim Erdfelt f0856a4c7d
Fixed war file unpacking 2022-10-17 15:19:56 -05:00
Joakim Erdfelt a454150e7f
Improved addClassPath and addJars behavior
+ Less code
+ Corrected javadoc
2022-10-17 15:19:32 -05:00
Joakim Erdfelt 3e8697f926
Log bad Classpath URI entries 2022-10-17 15:18:43 -05:00
Joakim Erdfelt 81b1a6688d
Better use of WebAppContext.getResourceFactory() 2022-10-17 15:15:05 -05:00
Joakim Erdfelt 0e25d98a9d
Handle bad ContextHandler.setBaseResource more clearly 2022-10-17 15:10:55 -05:00
Jan Bartel e8b818db15 Reenable ee9 RequestScopedSessionSaveTest. 2022-10-17 17:15:02 +11:00
Jan Bartel a3bf740f42 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-10-17 11:36:40 +11:00
Simone Bordet a6f5e1fe8f
Merge pull request #8705 from eclipse/jetty-12.0.x-reenable-customrequestlog
Jetty 12 - Re-enabled RequestLog tests.
2022-10-14 10:30:12 +02:00
Joakim Erdfelt 45e706cb67
Move Resource.combine() methods to ResourceFactory 2022-10-13 14:08:21 -05:00
Joakim Erdfelt 28d448aef6
Fixing directory location name for additional classpath elements 2022-10-13 09:59:07 -05:00
Joakim Erdfelt b36e4d86c5
New test for tiny names and resource base name 2022-10-13 09:57:41 -05:00
Joakim Erdfelt 5148de7105
Making tokenPath creating reliable 2022-10-13 09:56:43 -05:00
Joakim Erdfelt 06d82d30e5
Making tokenPath creating reliable 2022-10-13 09:56:33 -05:00
Joakim Erdfelt 39f77f7e26
Increasing reliability of test on ee9/ee8 2022-10-13 09:55:57 -05:00
Joakim Erdfelt 0bd1253679
Increasing reliability of test on ee9/ee8 2022-10-13 09:55:45 -05:00
Joakim Erdfelt 2be5a2bda4
Increasing reliability of test when run on different filesystems 2022-10-13 09:55:18 -05:00
Joakim Erdfelt 5ae363d4e1
Increasing reliability of test on ee9/ee8 2022-10-13 09:54:27 -05:00
Joakim Erdfelt fee44a65f5
Adding TODO about odd WEB-INF behavior 2022-10-13 09:54:02 -05:00
Joakim Erdfelt c9910cec13
ServerListener uses Path as it has to Write a file reliably 2022-10-13 09:53:39 -05:00
Joakim Erdfelt caf69690ca
Adding TODO about copyTo() with IncludeExcludeSet 2022-10-13 09:53:18 -05:00
Joakim Erdfelt c66d64f761
Perform URI check properly, skip ResourceFactory for LocationEntry check 2022-10-13 09:50:22 -05:00
Joakim Erdfelt 6f91c93c06
Use MavenPaths.targetTestDir() instead 2022-10-13 09:49:52 -05:00
Joakim Erdfelt 58b416952c
Cleanup AttributeNormalizerTest 2022-10-13 09:49:03 -05:00
Lachlan Roberts 57f71ce77e extract the generation of getCompressedContentFormats to separate contentFactory
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-13 18:08:50 +11:00
Lachlan Roberts 2d161bfecd cleanups of HttpContentWrapper and ResourceService
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-13 17:25:47 +11:00
Olivier Lamy 573f27fd88
cherry-pick of #7803 (#8708)
Signed-off-by: Olivier Lamy <olamy@apache.org>
2022-10-13 15:53:38 +10:00
Simone Bordet 557696653d
Re-enable RequestLog tests.
Re-implemented features that were commented out.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-12 17:46:49 +02:00
Lachlan Roberts 6771db40bf replace use of CachedContentFactory with CachingContentFactory
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-12 19:20:35 +11:00
Lachlan Roberts affa747b21 use jetty-core ResourceContentFactory in ee9
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-12 18:52:01 +11:00
Lachlan Roberts 6db4bf8aa0 remove getPrecompressedContents from HttpContent and ee9 impl
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-12 18:44:00 +11:00
Lachlan Roberts 6a6681a2df fix stampede creating CachingHttpContent & remove usage of getPreCompressedContentFormats
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-12 16:11:33 +11:00
Jan Bartel 756cf2102e
Fix jaas demos (#8689)
* Fix jaas demos add distro test
2022-10-12 09:33:14 +11:00
Lachlan Roberts a7383ea4de only check file modified time once per second for cached files
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-11 18:41:56 +11:00
Lachlan Roberts 1353f16d57 Refactor for CachingContentFactory and ResourceService
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-10-11 11:08:42 +11:00
Simone Bordet 2cbb0e19e0
Forward port of PR #7778 to `jetty-12.0.x`.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-10 16:22:26 +02:00
Olivier Lamy b1f8019860
simplify poms, add back missing changes from #7850 and #7687 (#8697)
* simplify poms, add back missing changes from #7850
* remove non used plugin, missing from #7687


Signed-off-by: Olivier Lamy <olamy@apache.org>
2022-10-10 12:52:40 +10:00
Joakim Erdfelt 1ae87e03bb
Merge remote-tracking branch 'origin/jetty-12.0.x' into fix/jetty-12-servlet-pathmapping-regex 2022-10-07 08:43:49 -05:00
Simone Bordet c785f08b17
[Jetty 12] Made WebSocket over HTTP/2 work. (#8685)
* Made WebSocket over HTTP/2 work.

Re-enabled tests, and restored HTTP2StreamEndPoint,
as well as implemented getTunnelSupport() for HTTP/2.

Removed from HttpStream methods for upgrade that are
not necessary anymore.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-07 12:50:42 +02:00
Joakim Erdfelt dd3e3cf6e8
Aligning changes between ee9 & ee10 2022-10-07 05:36:20 -05:00
Joakim Erdfelt bada439bac
Missed ee9 changes 2022-10-07 05:26:06 -05:00
Joakim Erdfelt 9acc24212e
Merge pull request #8692 from eclipse/fix/jetty-12-remove-qosfilter-deprecated-methods
Jetty 12 - Remove deprecated methods from QoSFilter
2022-10-07 05:21:50 -05:00
Joakim Erdfelt 3dd47d1bff
Cleanup post-cherry-pick of RegexPathSpec changes
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2022-10-07 05:12:56 -05:00
Joakim Erdfelt 25dd6d0ef7
Cherry-pick of Improvements to PathSpec for Jetty 10.0.x (#8136)
* Cherry-pick of Improvements to PathSpec.
* From commit: 5b4d1dd1c6
* Fixing ConstraintSecurityHandler usage of PathMappings
* Fixing bad INCLUDE logic from cherry-pick in ServletHandler.doScope()
* Cleanup of non ServletPathSpec behaviors in ServletPathMapping class
* Skip optional group name/info lookup if regex fails.
* Prevent NPE on static servletPathMappings
* Update WebSocketMappings to use new PathMappings.getMatched(String)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2022-10-06 15:50:18 -05:00
Greg Wilkins 351fe53c9a
Fix #7891 regex pathInfo (#7892)
Fix 7891 regex pathInfo

+ Use the pathSpec methods to set servletPath and pathInfo when possible

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2022-10-06 15:44:01 -05:00
Greg Wilkins 024a053455
Issue #7748 - allow override of path mapping behavior in ServletContextHandler (#7614)
Added protected method to ServletHandler to allow other servlet mappings (eg regex) in embedded/extended usage

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2022-10-06 15:42:12 -05:00
markslater 1f844e8d57
#7863 Include value of first accept-encoding header where multiple accept-encoding headers are given. (#7864)
Signed-off-by: markslater <mark.slater@mail.com>
2022-10-06 13:10:25 -05:00
Joakim Erdfelt d7288cbcd2
Remove deprecated methods from QoSFilter 2022-10-06 11:36:32 -05:00
Joakim Erdfelt 281f0dc495
Fix bad test cases from merge 2022-10-06 09:17:48 -05:00
Olivier Lamy eb9d07378a
move flatten mojo configuration in top pom, fix boms and remove non needed content (#8686)
Signed-off-by: Olivier Lamy <olamy@apache.org>
2022-10-06 06:50:45 +10:00
Joakim Erdfelt 9a7ce7a1f1
Fixing jackson-databind use in maven-plugins 2022-10-05 15:24:49 -05:00
Joakim Erdfelt 04dd551919
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-10-05 13:04:56 -05:00
Simone Bordet 7ed59f46c8
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-05 12:16:02 +02:00
Lachlan 05a4b96632
Merge pull request #8621 from eclipse/jetty-12.0.x-CachedContentFactory
Fix Caching ContentFactories in Jetty-12
2022-10-04 18:57:29 +11:00
Simone Bordet a3f2268766
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-03 18:28:36 +02:00
Lachlan 04e1df9373
Merge pull request #8619 from eclipse/jetty-12.0.x-8606-scopeListeners
Issue #8606 - Fix to ContextScopeListener for AsyncIOServletTest
2022-09-30 13:41:44 +10:00
Joakim Erdfelt 597a6af31d
Jetty 12 : `Descriptor` cleanup (#8611)
+ Sanity check Resource being provided
+ Descriptor toString changed to include full URI to descriptor
  so that it can be used consistently in Logging and Exception messages.
+ New Descriptor.toURI() for use in Servlet Source and other logging messages
+ Servlet Source value is now the URI of the Descriptor
+ More cleanup around `Source` location/name
   .getResource() must be a Resource
   as it's used in the AnnotationIntrospector
   all others use new .getName()
   Not all location/name usages can be loaded as
   a Resource.
2022-09-28 09:09:16 -05:00
Lachlan Roberts b893186f5e Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-8606-scopeListeners 2022-09-28 14:43:24 +10:00
Joakim Erdfelt 97eedaf9a6
Jetty 12 - Delay Resource Alias calculation until it's requested/needed (#8573)
* Delay Resource alias calculation until it's requested.
* Rename .getAlias() to .getTargetURI()
* PathResource resolveTargetAliasPath to resolveTargetPath
2022-09-27 13:03:47 -05:00
Joakim Erdfelt d73252a28c
Jetty 12 : `ResourceListing` produces XHTML (and is validated in test cases) (#8471)
* Produce XHTML output with tests that validate the XHTML.
* Adding ResourceListingTest and ensuring ResourceListing output is well formed.
* Introduce non-directory entry in ResourceListing test for ResourceCollection
2022-09-27 11:42:05 -05:00
Lachlan Roberts c58f769117 refactor test for resource lastModified comparisons
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-09-27 14:15:12 +10:00
Lachlan Roberts bed034c22d more fixes for test cases in DefaultServletTest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-09-27 11:01:56 +10:00
Simone Bordet 06be091089
Introduced [Callback|Promise]Completable.with(Consumer) to simplify usage of CompletableFuture APIs.
Updated code to use the new APIs.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-26 22:15:17 +02:00
Simone Bordet f8f60822a7
Restored interim responses functionality (100 Continue, 102 Processing, 103 Early Hints) (#8615)
* Restored interim responses functionality (100 Continue, 102 Processing, 103 Early Hints) for core, ee9 and ee10.

Added ProcessingProtocolHandler and EarlyHintsProtocolHandler for the client.

Re-enabled all tests for interim responses for all protocols.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-26 16:48:11 +02:00
Joakim Erdfelt 144c78fe39
Jetty 12 : QuickStart generation based on Path, usage based on Resource (#8614)
* QuickStart generation based on Path, usage based on Resource
* QuickStart usage in jetty-maven-plugin uses Path
* Cleanup MavenWebAppContext constructor exceptions
* Improving quickStart stream filtering and array conversion
* Creating WEB-INF, if missing, now more reliable
2022-09-23 12:50:52 -05:00
Joakim Erdfelt 3eca6901cc
Jetty 12 : ResourceFactory.of(WebAppContext) to WebAppContext.getResourceFactory() (#8610)
* ResourceFactory.of(WebAppContext) to WebAppContext.getResourceFactory()
2022-09-23 05:38:21 -05:00