Commit Graph

19468 Commits

Author SHA1 Message Date
Greg Wilkins 5164f7bb41 fixed merge
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 10:52:27 +10:00
Greg Wilkins 8f6e028f05 remove duplicate ignores
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 08:41:00 +10:00
Greg Wilkins af8587c108 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 08:15:41 +10:00
Joakim Erdfelt 149d9d4862 Fixes #4020 - Revert ExtensionFactory change to interface.
+ The change in commit 30dc103a12
  was done to allow the InflaterPool and DeflaterPool
  to be managed by the Jetty lifecycle.
+ This restore the original abstract class ExtensionFactory.
+ Had to break the traditional LifeCycle usage for a more
  non-traditional one in order to both, not break this existing
  API, and not introduce jetty-util to the webapp classloader.
+ This will restore API / binary compatibility for other
  projects, like spring-boot.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-26 13:40:32 -05:00
Greg Wilkins bde86467f4
Issue #3806 - Make Async sendError fully Async (#3912)
* Issue #3806 async sendError

Avoid using isHandled as a test withing sendError as this can be
called asynchronously and is in a race with the normal dispatch of the
request, which could also be setting handled status.

The ErrorHandler was dispatching directly to a context from within
sendError.  This meant that an async thread can call sendError and be
dispatched to within the servlet container at the same time that the
original thread was still dispatched to the container.

This commit fixes that problem by using an async dispatch for error
pages within the ErrorHandler.  However, this introduces a new problem
that a well behaved async app will call complete after calling
sendError.  Thus we have ignore complete ISEs for the remainder of
the current async cycle.

Fixed the closing of the output after calling sendError. Do not
close if the request was async (and thus might be dispatched to an
async error) or if it is now async because the error page itself is
async.

* updates from review
* better tests
* revert ignore complete
* added some TODOs
* more TODOs
* fixed rename
* cleanup ISE and more TODOs
* refactored to call sendError for uncaught exceptions rather than onError
* more of the refactor
* extra tests for sendError from completing state

Reworked HttpChannelState and sendError so that sendError is now
just a change of state. All the work is done in the ErrorDispatch
action, including calling the ErrorHandler.  Async not yet working.

Additional tests

Converted ERRORED state to a separate boolean so it can be used for
both Sync and Async dispatches.

Removed ASYNC_IO state as it was just the same as DISPATCHED

The async onError listener handling is now most likely broken.


WIP making sendError simpler and more tests pass
WIP handling async and thrown exceptions
WIP passing tests

Improved thread handling

removed bad test

Implemented error dispatch on complete properly
more fixed tests

sendError state looks committed

- Added resetContent method to leave more non-content headers during sendError
- Fixed security tests
- simplified the non dispatch error page writing.  Moved towards being able to write async

* fixed gzipHandlerTest

* Updated handling of timeout errors.  According to servlet spec,
exceptions thrown from onTimeout should not be passed to onError, but
just logged and ignored:

   If an exception is thrown while invoking methods in an AsyncListener,
   it is logged and will not affect the invocation of any other AsyncListeners.

* This changes several tests.

* Dispatcher/ContextHandler changes for new ERROR dispatch handling. Feels a bit fragile!

* Fixed tests in jetty-servlets
* Fixed tests in jetty-proxy

* more test fixes

* Fixed head handling
reverted unnecessary changes
Improved reason handling

WIP on fully async error handling.
Simplified HttpChannelState state machines to allow for async actions
during completing

more WIP on fully async error handling.

sendError and completion are not both non-blocking, without using
a startAsync operation. However we are lacking unit tests that actually
exercise those code paths.

* Simplified name of states
Added test for async completion
* Cleanups and javadoc
* Cleanups and javadoc
* remove snake case
* feedback from review
* Write error page into fixed pooled buffer

Use the response to get/release a pooled buffer into which the error
page can be written.  Make it a fixed sized buffer and if it overflows
then no error page is generated (first overflow turns off showstacks
to save space).

The ErrorHandler badly needs to be refactored, but we cannot change
API in jetty-9

* More test fixes for different error page format
* minor cleanups
* Cleanup from Review
* Fixed javadoc
* cleanups and simplifications
* Cleanup from Review
* renaming and some TODOs
* Cleanup from Review
* Checkstyle fixes
* Cleanup from Review
* Code cleanups and simplifications
* fixed debug
* Cleanup from Review
* Ensure response sent before server shutdown
* removed unnecessary optimisation
* fixed duplicate from merge
* Updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-26 17:55:58 +10:00
Jan Bartel 9534940578 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-26 15:55:08 +10:00
Jan Bartel 0f8230c05b
Issue #3936 Provide write-through modes for the NullSessionCache (#3984)
* Issue #3936 Provide write-through modes for the NullSessionCache

Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-26 15:22:20 +10:00
Greg Wilkins 53fc01793c Updates from review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-26 13:20:07 +10:00
Greg Wilkins b2aa083778 Updates from review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-26 13:18:12 +10:00
Joakim Erdfelt f692af3d53 Issue #155 - Adding public ClientContainer(HttpClient) constructor
+ This helps with programmatic configuration of HttpClient
  layer (for SSL and Proxy).

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-23 11:55:13 -05:00
Joakim Erdfelt 36ef975353 Merge branch `jetty-9.4.x` into `jetty-10.0.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java
#	jetty-http/src/test/java/org/eclipse/jetty/http/CookieCutterTest.java
#	jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DefaultServletTest.java
#	jetty-util/src/test/java/org/eclipse/jetty/util/resource/FileSystemResourceTest.java
2019-08-23 08:52:52 -05:00
Joakim Erdfelt 89d7469806 Merge branch 'jetty-10.0.x' of github.com:eclipse/jetty.project into jetty-10.0.x 2019-08-23 07:41:48 -05:00
Joakim Erdfelt 1867d24ef7
Merge pull request #4001 from eclipse/jetty-9.4.x-4000-swedish-unicode-file-serving
Issue #4000 - new SameFileAliasChecker to help with NFC/NFD UTF-8 differences
2019-08-23 07:27:32 -05:00
Joakim Erdfelt f15ca7765e
Merge pull request #3994 from eclipse/jetty-9.4.x-3985-cookie-parsing
Fixes #3985 - Updates to CookieCutter to reject no-equal cookies
2019-08-23 07:27:23 -05:00
olivier lamy cf592469aa checkstyle fixes.
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-23 13:09:15 +10:00
olivier lamy 80d513e979 junit failure after bad merge
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-23 10:56:24 +10:00
Joakim Erdfelt 9e6b24e916 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2019-08-22 17:04:22 -05:00
Joakim Erdfelt 12e1473fd0 Adding reference to javax.websocket issue
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-22 17:04:01 -05:00
Joakim Erdfelt 6aaf22ec6c Merge branch `jetty-9.4.x` into `jetty-10.0.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-22 17:02:19 -05:00
Joakim Erdfelt 45dfd14cd5 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2019-08-22 16:45:25 -05:00
Joakim Erdfelt 5bcbe0f9d9 Adding javax.websocket secure client example
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-22 16:45:04 -05:00
olivier lamy e1656aecc7 fix compilation
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-23 06:58:54 +10:00
Joakim Erdfelt ceff82ac57 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2019-08-22 15:09:44 -05:00
Joakim Erdfelt d0ec6e7d07
Merge pull request #3995 from eclipse/jetty-9.4.x-3983-jarfileresource-list
Fixes #3983 - JarFileResource directory listing is invalid
2019-08-22 15:09:16 -05:00
Joakim Erdfelt 318045cd87 Issue #3985 - Applying PR Review to CookieCutter
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-22 12:46:23 -05:00
Joakim Erdfelt e7765ab576
Merge pull request #4015 from akurtakov/jetty-9.4.x
Update Tycho and Eclipse CBI plugins.
2019-08-22 08:52:19 -05:00
Alexander Kurtakov 7f5aa89042 Update Tycho and Eclipse CBI plugins.
* Tycho to 1.4.0
* CBI to 1.1.7

These updates are important for both speed and m2e compatibility so
warnings are not shown in the eclipse ide.

Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
2019-08-22 16:06:06 +03:00
olivier lamy 595e058fa3 touch to test github/jenkins
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-22 20:53:46 +10:00
olivier lamy 2cbdb27e5b touch to test github/jenkins
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-22 20:51:34 +10:00
olivier lamy a36af67abf Merge branch 'jetty-9.4.x' into jetty-10.0.x 2019-08-22 20:45:57 +10:00
Olivier Lamy fe3d3f7158
fix checkstyle in test sources (#4013)
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-22 19:56:41 +10:00
Joakim Erdfelt 88e37b177c Issue #4000 - Name change to isSameName
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-21 17:11:44 -05:00
Simone Bordet 1a0f08b84d Improve test performance.
Running with the LEGACY compliance will take ~10 minutes for this test.
Running with the RFC7578 compliance will take ~1 min 45 secs.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-21 21:13:13 +02:00
Joakim Erdfelt c1c241349e Issue #3985 - Applying PR Review to CookieCutter
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-21 12:54:26 -05:00
Joakim Erdfelt 4ab0be9b1b Issue #3983 - Applying PR review to JarFileResource
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-21 12:43:25 -05:00
Joakim Erdfelt 30bd3914cf Issue #4000 - SameFileAliasChecker to help with NFD/NFC
+ Adding SameFileAliasChecker to help with environments
  where the Alias and the Path point to the same file,
  by relying on the FileSystem and Path implementation
  to make the determination if the two Path references
  truly point to the same file.
+ Minor cleanup of FileSystemResourceTest
+ Additional DefaultServletTest for this UTF-8 differences

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-21 12:21:04 -05:00
Simone Bordet 32fe4e5ca8 Issue #3978 - HTTP/2 vulnerabilities.
Fixed load test that required `RateControl.NO_RATE_CONTROL`.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-21 11:36:06 +02:00
Greg Wilkins d04c5f1e2a Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-20 16:23:09 +10:00
Bruce a1bb3b4491 fix formatting and change comment flags to attributes
Signed-off-by: Bruce MacDonald <brucewmacdonald@gmail.com>
2019-08-20 15:12:03 +10:00
Bruce 6ad148c8f9 parse samesite from cookie comment flag utility functions
Signed-off-by: Bruce MacDonald <brucewmacdonald@gmail.com>
2019-08-20 15:12:03 +10:00
Bruce 2e5f6fca4b parse SameSite specifier from cookie comment and move HttpOnly comment parsing to org.eclipse.jetty.http.HttpCookie
Signed-off-by: Bruce MacDonald <brucewmacdonald@gmail.com>
2019-08-20 15:12:03 +10:00
Bruce 7c691acbbe use null instead of EXCLUDED to indicate no SameSite attribute should be sent
Signed-off-by: Bruce MacDonald <brucewmacdonald@gmail.com>
2019-08-20 15:12:03 +10:00
Bruce 216f71469b Issue #3040 - Allow RFC6265 Cookies to include optional SameSite attribute
Signed-off-by: Bruce MacDonald <brucewmacdonald@gmail.com>
2019-08-20 15:12:03 +10:00
Lachlan Roberts eabae232e5 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-08-20 12:59:31 +10:00
Lachlan 44986be6c0
fix flaky test ClientCloseTest.testStopLifecycle() in jetty 9.4.x (#3990)
* fix flaky test ClientCloseTest.testStopLifecycle() in 9.4.x

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

* test code cleanups in ClientCloseTest

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-08-20 12:49:52 +10:00
Joakim Erdfelt ef3f696a11 Issue #4000 - PathResource alias detection work around alt UTF-8 style
+ OSX File is `swedish-å.txt`
+ OSX has NFD form UTF-8 characters. `swedish-a%CC%8A.txt`
+ HTTP uses normal form UTF-8. `swedish-%C3%A5.txt`
+ A HTTP GET request should work against the resource
  being requested, regardless of UTF-8 style used.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-19 13:52:22 -05:00
Joakim Erdfelt 407b564320 Issue #4000 - adding unit test for raw Resource access for unicode file.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-19 12:52:43 -05:00
Simone Bordet 5184c4ec3d Issue #3978 - HTTP/2 vulnerabilities.
Small fixed after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-19 11:38:01 +02:00
olivier lamy 6f2a93d614 Merge branch 'jetty-9.4.x' into jetty-10.0.x 2019-08-19 13:12:10 +10:00
Olivier Lamy 95f7fddc59
ServletContext#setSessionTrackingModes must throw IAE if SSL and another mode (#3976)
* according to Javadoc and failing tck tests
ServletContext#setSessionTrackingModes
IllegalArgumentException - if sessionTrackingModes specifies a combination of SessionTrackingMode.SSL with a session tracking mode other than SessionTrackingMode.SSL

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* test adding only SSL

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* fixes from Jan review

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* fix package order

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-19 12:54:05 +10:00