Commit Graph

4244 Commits

Author SHA1 Message Date
Simone Bordet 6bbec7f3b0 Issue #4411 - Jetty server spins on incomplete request.
Fixed HttpInput to be in READY state if an error is detected
before the call to setWriteListener().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-12-11 00:11:29 +01:00
Joakim Erdfelt 2ee079feb1
Merge 'jetty-9.4.x' of github.com:eclipse/jetty.project into jetty-9.4.x 2019-12-06 13:24:43 -06:00
Joakim Erdfelt 53eda03203
Making exception message more clear
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-12-06 13:24:30 -06:00
Simone Bordet 839846d9a6 Fixes #4392 - Suppress logging of QuietException in HttpChannelState.asyncError().
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-12-03 13:01:28 +01:00
Greg Wilkins 85cda88b40
Issue #4376 Async Content Complete (#4377)
* Issue #4376 Async Content Complete

Added test harness to reproduce unready completing write.
Fixed test by not closing output prior to becoming READY

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4376 Async Content Complete

ERROR state still needs to be closed!

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4376 Async Content Complete

close after last blocking write

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4376 Async Content Complete

If completion has to do a flush, then we need a call to closed to
avoid leaking buffers.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4376 Async Content Complete

Reformat

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-12-03 08:50:36 +11:00
Joakim Erdfelt d99ae19201
Merge pull request #4290 from eclipse/jetty-9.4.x-4269-restore-PrintWriter-contract
Issue #4269 - Restoring PrintWriter contract on errors
2019-12-02 15:22:22 -06:00
Joakim Erdfelt 5d7f7d6499 Merge branch 'release-9.4.24' into jetty-9.4.x 2019-11-26 10:31:28 -06:00
Joakim Erdfelt 0f7a3b2d91 Updating to version 9.4.25-SNAPSHOT 2019-11-20 16:08:38 -06:00
Joakim Erdfelt 217602e97f
Issue #4334 - Enhancing JSON Test
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-20 15:48:22 -06:00
Joakim Erdfelt 363d5f2df3 Updating to version 9.4.24.v20191120 2019-11-20 15:25:01 -06:00
Joakim Erdfelt cf0df6e3ff
Issue #4334 - Improve testing of ErrorHandler behavior
+ Cleanup from PR review

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-20 13:17:17 -06:00
Joakim Erdfelt 9e40fc9a6f
Issue #4334 - Improve testing of ErrorHandler behavior
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-20 09:47:33 -06:00
Joakim Erdfelt dc03431de2 Merge branch 'release-9.4.23' into jetty-9.4.x 2019-11-20 07:14:53 -06:00
Joakim Erdfelt 61cbb7529d
Removing duplicate log output
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-18 16:44:48 -06:00
Joakim Erdfelt 453d41940b Updating to version 9.4.24-SNAPSHOT 2019-11-18 13:52:51 -06:00
Joakim Erdfelt abbccc65d6 Updating to version 9.4.23.v20191118 2019-11-18 13:09:44 -06:00
Jan Bartel 318246eb24
Issue #4156 Remove use of PlaceHolderSession for simultaneous session loading (#4304)
* Issue #4156 Remove use of PlaceHolderSession for simultaneous session loading.
2019-11-18 09:06:38 +11:00
Greg Wilkins 32931fac7b
Issue #4247 SameSite Session Cookie (#4271)
* Issue #4247 SameSite Session Cookie

Allows sameSite cookie settings to be configured in SessionCookieConfig comments

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4247 SameSite Session Cookies

Use non versioned cookie

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4247 SameSite Session Cookies

Added test and fixed getCommentWithAttributes

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4247 - Updating unit tests for HttpCookie

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4247 SameSite Session Cookie

While it may be best practise to always use Secure cookies when SameSite is None, there is nothing in the RFC that mandates it and thus I don't believe we should prevent such a configuration.  If browsers enforce this, then users will find out soon enough... and if browsers change, then we are not required to do a new release to match.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4247 SameSite Session Cookie

For cookie comments with multiple SameSite attributes, the most strict
value is used. So `Strict` has precedence over `Lax` which has
precedence over `None`.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-11-14 11:56:40 +11:00
Greg Wilkins b24c6ce68d
Issue #2340 ServletContext cleanup (#4307)
* Issue #2340 ServletContext cleanup

A minor cleanup of the ServletContext implementation classes.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #2340 ServletContext cleanup

cleanup after review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-11-14 11:52:03 +11:00
Joakim Erdfelt a44a46f3f1
Adding stalebot integration
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-13 15:43:48 -06:00
Joakim Erdfelt 6b96e3db21
Adding stalebot integration
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-13 15:42:07 -06:00
Joakim Erdfelt ff7adab55a
Issue #4269 - Correcting PrintWriter test
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-13 14:47:53 -06:00
Greg Wilkins 24df8c59a3
Issue #4279 Writer close deadlock (#4288)
Do not close the actual writer from closed.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-11-13 11:03:17 +11:00
Greg Wilkins fe4b9cf366
Issue #4161 Write LifeCycleViolation (#4294)
* Issue #4161 - TestCase that can replicate problem on OSX

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4161 - Naming Server threadpool (to help with debugging)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4161 - bumping up test file size to 10 MB

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4161 Write LifeCycleViolation

Do not callback on write completion until after state has been changed and notifications made.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4161 Write LifeCycleViolation

Added a unit test that replicated the problem.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4161 - `EofException: request lifecycle violation` in stderr.

Moved notifications of commit and content listeners back to succeeded().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>

* Issue #4161 - Improved Logging for test-integration

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4161 - Reducing size of test file

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-13 11:02:12 +11:00
Greg Wilkins ee0f9fc1d0
Issue #4033 Percent Encoded Bad Requests (#4272)
* Modernizing testcase

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4033 Percent Encoded Bad Requests

Added test to demonstrate bad percent encoded request

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4033 - adding sanity test for percent paths and checkAlias()

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Eliminating 9.3.0.RC0 dependency

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4033 - More tests for Resource checkAlias() behavior

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4033 - Splitting badDecodePath

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4033 - More badDecodePath tests

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4033 Percent Encoded Bad Requests

reverted decodePathBehaviour

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* testing pull request building

* Issue #4033

updates after review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-11-11 12:01:26 +11:00
Lachlan c336616c96
Issue #2709 - reduce default headerCacheSize to 1024 (#4292)
make headerCacheSize on HttpReceiverOverHTTP configurable

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-11-08 21:57:49 +11:00
Joakim Erdfelt c0866ebeae
Issue #4269 - Restoring PrintWriter contract on errors
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-07 15:59:13 -06:00
Greg Wilkins 070d2b235e Issue #4264 Revert doError signature
revert the doError signature.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-11-07 09:31:52 +11:00
Olivier Lamy 37aa5a17e0
Issue #4243 invalid json error response from ErrorHandler (#4249)
* Issue #4243  invalid json error response from ErrorHandler

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-11-06 09:09:44 +10:00
Simone Bordet e09444eeb5 Issue #3863 - Enforce use of SNI (#4085)
* Issue #3863 -  Enforce use of SNI.

Introduced SslContextFactory.rejectUnmatchedSNIHost (default false)
so that if no SNI is sent, or SNI does not match a certificate,
then the TLS handshake is aborted.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>

* Issue #3863 - Enforce use of SNI.

Updates after review.
Introduced SslContextFactory.SNISelector to allow application to write
their custom logic to select a certificate based on SNI information.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>

* Issue #3863 Enforce SNI

Added two sniRequired fields - one at SslContextLevel and the other at the SecureRequestCustomizer.  This allows rejection either at TLS handshake or by 400 response.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3863 Enforce SNI

cleanups from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3863 Enforce SNI

improved comments

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3863 Enforce SNI

syntax sugar

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3863 SNI

Updates from review.  Extra test for sniSelector function

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-11-05 09:07:34 +11:00
Greg Wilkins 869c3b51ce
Issue #4265 Remove doError (#4266)
* Issue #4265 Remove doError

The doError method and the ErrorDispatchHandler class were
hang overs from when we needed to dispatch into a context to get sendError called, which would then generate the error page.

Now sendError doesn't do any generation, rather it changes state that arranges either for a minimal error page to be generated or an ERROR dispatch to a real handler/servlet to generate the error page.

Thus the ErrorDispatchHandler and doError methods can now be removed.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4265 Remove doError

Moved the error page dispatching logic back to the ErrorHandler class to assist with backwards compatibility

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4265 Remove doError

Moved the error page dispatching logic back to the ErrorHandler class to assist with backwards compatibility

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4265 doError

Updates from review.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-11-05 08:45:46 +11:00
Joakim Erdfelt 1ed13b6b30 Updating to version 9.4.23-SNAPSHOT 2019-10-22 09:19:41 -05:00
Joakim Erdfelt b1e6b55512 Updating to version 9.4.22.v20191022 2019-10-22 08:20:50 -05:00
Joakim Erdfelt 890c0b26cb Fixes #4203 and #4204 - Transfer-Encoding + Content-Length behaviors (#4205)
* Issue #4203 - Updating test to verify report on Transfer-Encoding

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Fixes #4203 - Transfer-Encoding + Content-Length is 400 Bad Request

+ Fixing validation to not be header order dependent.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4203 - Fixing hasTransferEncoding reset and testcase assumption

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4204 - Transfer-Encoding RFC7230 behaviors

+ More test cases and implementation.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4204 - Transfer-Encoding RFC7230 behaviors

+ Adjusting HttpParser to handle the case where we have multiple
  Transfer-Encoding headers and none declare the 'chunked' token.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4204 - Transfer-Encoding RFC7230 behaviors

+ Making changes from PR review

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4203 Transfer Encoding

request with TE and no chunking is a Bad Request

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-19 08:05:15 +11:00
Greg Wilkins 3d19f61122
Issue #4193 - Fix InetAccess port control (#4206)
* issue exclude/include con name InetAccesHandler - add better unit test

this logic:

        String name =
baseRequest.getHttpChannel().getConnector().getName();
        return _names.test(name) && _addrs.test(addr);

Is not correct. it's treating the connector name exactly like the
filter. But that's not what it's intended to do. It's supposed to tell
what connectors are applicable to this filter. And what connectors are
not affected.

For example in the unit test there exists 2 connectors:

http
tls

We want to restrict the http connector, but we want to leave tls
connector alone.

So we would specify:

include = 192.168.1.1-192.168.1.254
includeConnector = http

The way the logic is above, it is treating the connector name as if it's
the filter itself. Which is not what I intended.

What i need in psuedo-code is this:


   if (there are no "include connectors" OR if this connector is
included) AND (if this connector is not in the excluded list)
     ---> Then apply the IP filter.

Signed-off-by: Nicholas DiPiazza <nicholas.dipiazza@lucidworks.com>

* exclude should take precedence over include

Signed-off-by: Nicholas DiPiazza <nicholas.dipiazza@lucidworks.com>

* Issue #4193 InetAccessHandler

reverted changes to IncludeExcludeSet

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4193 InetAccessHandler

updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-18 09:03:28 +11:00
Greg Wilkins 894fc9b115
Issue #4208 - Content-Length in 304 (#4211)
* Issue #4208 Content-Length in 304

Added tests for RFC7230 section 3.3.2 for 304 and HEAD responses with content length.
Fixed HttpGenerator to set content-length in 304 response
Fixed insufficient content written check for 304

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4208 Content-Length in 304

Use contentLengthField

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-17 14:26:19 +11:00
Simone Bordet 869184c827
Merge pull request #4200 from eclipse/jetty-9.4.x-4190-deadlock_httpoutput_close
Fixes #4190 Jetty hangs after thread blocked in SharedBlockingCallbac…
2019-10-16 23:35:52 +02:00
Greg Wilkins 7cc552013e Issue #4191 Min GzipSize
updates from review from OP.
reverted static DEFAULT_MIN_GZIP_SIZE

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 22:07:51 +11:00
Greg Wilkins 2ee874a8ac Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-9.4.x-4191-min-gzip-size
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 22:00:52 +11:00
Greg Wilkins 031df2bd2e simplified javadoc
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 18:19:22 +11:00
Greg Wilkins 1881683726 Issue #4191 Min GzipSize
updates from review in absence of OP.
Make break even size a warning rather than a hard limit.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 16:22:14 +11:00
Greg Wilkins 73924d2774
Issue #4188 Spin in close of GzipHandler (#4198)
* Issue #4188 Spin in close of GzipHandler

Cleanup and simplify code

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4188 Spin in close of GzipHandler

Fix slice code. Added unit test for it.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4188 Spin in close of GzipHandler

Fixed last slice.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* cleanup from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 14:12:52 +11:00
Jan Bartel 92c8bb8dd5
Issue #4158 Re-enable support for duplicate session cookies. (#4168)
* Issue #4158 Re-enable support for duplicate session cookies.

Signed-off-by: Jan Bartel <janb@webtide.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 14:08:51 +11:00
Greg Wilkins 2eb251a4b8 fix logging defaults to INFO
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-16 13:53:57 +11:00
Joakim Erdfelt fa25d560b3
Fixing typo
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-10-15 13:52:39 -05:00
Simone Bordet 6b26ac9ee9 Fixes #4190 Jetty hangs after thread blocked in SharedBlockingCallback.block() called by HttpOutput.close.
Now releasing the buffer when in CLOSING state.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-15 15:47:03 +02:00
Simone Bordet a0e90bab96 Fixes #4190 Jetty hangs after thread blocked in SharedBlockingCallback.block() called by HttpOutput.close.
Now handling correctly the CLOSING case in HttpOutput.close().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-15 12:45:10 +02:00
Joakim Erdfelt 0fbb507841
Issue #4191 - GzipHandler.minGzipSize cannot be lower then 23.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-10-14 13:21:01 -05:00
Greg Wilkins f09e03c586
Issue #4156 - Session Already in Cache during forwarding (#4159)
* Issue #4156 - Adding test to replicate issue

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4156 Session already in cache

+ check validity of sessions in getSession(SessionHandler)
+ do not replace session in doScope if SessionHandler is the same.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-14 11:18:37 +11:00
Simone Bordet ec56739d3c
Merge pull request #4180 from eclipse/jetty-9.4.x-4179-SendCallback-gc
Issue #4179 SendCallback GC
2019-10-10 12:45:30 +02:00