Commit Graph

4486 Commits

Author SHA1 Message Date
Greg Wilkins b46b25b450 release buffer on overflow
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-02-19 22:38:58 +01:00
Simone Bordet ed7f337856 Issue #4518 - Add a mechanism that allows running multiple protocols on the same port.
Made test methods public, so that they will work fine in JDK 11 and JPMS.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-02-17 00:53:44 +01:00
Simone Bordet 9f7a82b128
Merge pull request #4519 from lorban/composable-conn-factories
Fixes #4518 -  Add a mechanism that allows running multiple protocols on the same port.
2020-02-16 19:25:04 +01:00
Greg Wilkins 652428ad70 Tests #4573 X-Forwarded ordering
Added tests for header ordering
fixed cut-and-paste error of _for to _host

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-02-16 11:04:34 +01:00
Greg Wilkins f50c2654b9 Fixes #4541 Large Headers
Added a HEADER_OVERFLOW result as per review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-02-06 21:17:58 +01:00
Ludovic Orban 386d9348ca Use contants for CR and LF fields index
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2020-02-06 10:06:33 +01:00
Greg Wilkins 1b59e42294 Issue #4541 Large response header
Fix #4541 by initially allocated a header buffer of `min(_config.getResponseHeaderSize(), _config.getOutputBufferSize())`
Only allocate a buffer of `getResponseHeaderSize` if an overflow results.

This should have no effect on the majority of responses where `getOutputBufferSize` is greater than `getResponseHeaderSize` other than the cost of a min operation.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-02-05 10:29:41 +01:00
Ludovic Orban 5df1ad9b66 change the format of detector's generated protocol name
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2020-02-04 12:42:35 +01:00
Ludovic Orban 58b1db610c detectAndUpgrade() shortcut on empty buffer
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2020-02-04 10:49:27 +01:00
Ludovic Orban 37edc016d2 improve debug logs
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2020-02-04 09:21:41 +01:00
Ludovic Orban 75b4719592 Implement detector connection factory with protocol detection mechanism
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2020-02-03 16:56:53 +01:00
Jan Bartel ecd0fe97f7
Issue #4520 Reinstate throw of UnreadableSessionDataException (#4528)
* Issue #4520 Reinstate throw of UnreadableSessionDataException

Signed-off-by: Jan Bartel <janb@webtide.com>
2020-02-01 11:13:58 +01:00
Greg Wilkins b6f2fd2432
Issue #4529 Servlet in error page (#4530)
Added option for #4529 to control showing the servlet in an error page.
Error configuration really needs a module, but will add in 10 with a refactor.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-01-31 19:53:05 +01:00
Greg Wilkins f88eb73a91
Issue #4533 Hard close from Dispatcher (#4534)
* Issue #4533 Hard close from Dispatcher

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

#4533 Do hard close from Dispatcher so response wrappers may intercept close.

* Issue #4533 Hard close from Dispatcher

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

#4533 improve test after review

* Issue #4533 Hard close from Dispatcher

Some renaming of methods to make it clear that softClose should only be used as part of sendError handling.  If softClose is used by other components, then sendError can be prevented from setting the error status.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-01-31 11:55:14 +01:00
Jan Bartel 9850c29839
Issue #4247 use context default for samesite cookie attribute (#4512)
* Issue #4247 use context default for samesite cookie attribute

Signed-off-by: Jan Bartel <janb@webtide.com>
2020-01-29 11:05:35 +01:00
Greg Wilkins 56754f4a29
Issue #4504 Forwarded Host and Server (#4511)
X-Forwarded-Host has precedence of X-Forwarded-Server and outcome is not order dependent.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-01-24 11:20:52 +01:00
Joakim Erdfelt 56fc476d55 Updating to version 9.4.27-SNAPSHOT 2020-01-17 07:00:10 -06:00
Joakim Erdfelt 7b38981d25 Updating to version 9.4.26.v20200117 2020-01-17 06:21:47 -06:00
Joakim Erdfelt 8c65309963
Addressing Checkstyle violations in src/test/java
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-01-14 12:33:34 -06:00
Greg Wilkins 96f6f2bb8d
Fix #4461 HttpOutput Aggregation (#4466)
* Issue #4461 HttpOutput Aggregation

Added tests to check that aggregation continues after first flush of an aggregated buffer (this triggers both #4461 and the discovered bug of not aggregating because of empty at capacity aggregate buffer).

Added getAggregateSize method that does a compact to avoid empty at capacity aggregate buffer

Call onWriteComplete if residue of an overflow aggregation can itself be aggregated.

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

* Issue #4461 HttpOutput Aggregation

Removed implicit compact from GzipHandler

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

* Issue #4461 HttpOutput Aggregation

Improve test coverage

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

* Issue #4461 HttpOutput Aggregation

Remove case that can never happen.

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

* Issue #4461 HttpOutput Aggregation

updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-01-10 07:20:54 +11:00
Simone Bordet 923ec38adf Merged branch 'jetty-9.3.x' into 'jetty-9.4.x'. 2020-01-07 16:51:25 +01:00
Simone Bordet e3c8546667 Merged branch 'jetty-9.2.x' into 'jetty-9.3.x'. 2020-01-07 16:35:05 +01:00
Simone Bordet de890bb1b7 Happy New Year 2020.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-01-07 16:25:32 +01:00
Simone Bordet aed5a4458c Added forgotten @Deprecated annotation to deprecated method.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-01-07 15:40:46 +01:00
Joakim Erdfelt f4e7e4c3db Merge branch 'release-9.4.25' into jetty-9.4.x 2020-01-03 12:49:27 -06:00
olivier lamy e1371a1c13 happy new year
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-01-02 21:54:05 +01:00
Joakim Erdfelt 8974176c4b Updating to version 9.4.26-SNAPSHOT 2019-12-20 11:30:41 -06:00
Joakim Erdfelt a9729c7e7f Updating to version 9.4.25.v20191220 2019-12-20 10:46:56 -06:00
Joakim Erdfelt ccf04a47cd
Merge pull request #4375 from eclipse/jetty-9.4.x_small_improvment_jdbc
avoid non necessary objects allocation if session do not have any attributes data
2019-12-20 10:29:01 -06:00
Greg Wilkins c5acf96506
Jetty 9.4.x 4331 async close complete3 (#4409)
* 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 #4331 Async Write Complete

Test harness to reproduce unready when closing/completing.

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

* Issue #4331 Async Write Complete

test both PENDING and UNREADY

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

* Issue #4331 Async Write Complete

test cleanups

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

* Issue #4331 Async Close Complete

Cleanups of write

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

* WIP

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

* Issue #4331 Close Complete

Work in progress

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

* Issue #4331 Close Complete

Added async close to HttpWriter and ResponseWriter
Always use async close, with blocker if necessary.

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

* Issue #4331 Close Complete

Working async close complete!

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

* Issue #4331 Close Complete

invert test as we can now call complete when not ready!

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

* Issue #4331 Close Complete

fixed transition to ERROR state

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

* Issue #4331 Close Complete

async close after onError

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

* Issue #4331 Close Complete

minor cleanups

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

* Issue #4331 Close Complete

Fix for proxy tests

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

* Issue #4331 Close Complete

Fix write loop to handle clear of p=0,l=0 rather than p=l

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

* Issue #4331 Close Complete

Removed old close on all content mechanism
Cleanups and some more TODOs

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

* Issue #4331 Close Complete

a reworking of HttpOutput to separate out API state.

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

* Issue #4331 Close Complete

Soft close for Dispatcher
release buffer in onWriteComplete

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

* Issue #4331 Close Complete

Set _onError in onWriteComplete
NOOP callback instead of null

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

* Issue #4331 Close Complete

failure closes HttpOutput

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

* Issue #4331 Close Complete

Moved closedCallback handling to onWriteComplete

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

* Issue #4331 Close Complete

Additional test of complete during blocking write.

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

* Issue #4331 Close Complete

reimplemented blocking close to sometimes be async

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

* Issue #4331 Close Complete

ascii "art"

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

* Issue #4331 Close Complete

Code cleanup.  Use a CLOSE state rather than non null closedCallback to be clearer that it is a state.
Renamed close(Callback) to complete(Callback)
Renamed and simplified closed() to completed()

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

* Issue #4331 Close Complete

Do not dispatch
Better ascii art
improved close impl to be similar to complete

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

* Issue #4331 Close Complete

More test cases

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

* Issue #4331 Close Complete

retain execute behaviour in 9.4. review in 10.

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

* Improved javadoc and ascii art

* Improved CLOSING

Switch to CLOSING state as soon as last write is done, even if several non last channelWrites will be done.   This allows a subsequent call to close to know that nothing needs to be written and can avoid some EOF exceptions. Now onWriteComplete acts only on the passed in last parameter.

Added test for sendContent

* WIP

Aggregate within lock
pipeline test debug

* Avoid creating ignored exception when Idle or Failed.

* Try a parse without fill to avoid unconsumed input debug

* fixed pipeline size

* release buffer before callback

* turn off debug

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

* Issue #4331 Close Complete

Better javadoc
refactored onWriteComplete logic to be simpler
fixed bug with flush of last written byte

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

* Issue #4331 Close Complete

Completely reworked test harness for better coverage.

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

* Issue #4331 Close Complete

Reworked order of ifs to match logic above in onWriteComplete

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-12-19 12:17:11 +11:00
Simone Bordet 129a51c7a2
Fixes #4421 - HttpClient support for PROXY protocol. (#4424)
* Fixes #4421 - HttpClient support for PROXY protocol.

Implemented support for the PROXY protocol in HttpClient.

Introduced Request.tag(Object) to tag requests that belong
to the same group (e.g. a client address) so that they can
generate a different destination.

The tag object may implement ClientConnectionFactory.Decorator
so that it can decorate the HttpDestination ClientConnectionFactory
and therefore work both with and without forward proxy configuration.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-12-17 10:36:16 +01:00
Lachlan 584e264b0b
Clean up CustomRequestLog and fix the handling of the %u code. (#4397)
* Clean up CustomRequestLog and fix the handling of the %u code.
* Add test for logging of remote user with %u and %{d}u
* update javadoc to clarify that %u is only for servlet auth
* remove the prepended '?' when deferred authentication is checked
2019-12-17 11:28:39 +11:00
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
olivier lamy e58f570266 remove unused import
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-11-28 13:42:52 +10:00
olivier lamy 9576763c67 avoid non necessary objects allocation if session do not have any attributes data
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-11-28 11:15:48 +10: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
Joakim Erdfelt 43d95cd984 Updating to version 9.3.29-SNAPSHOT 2019-11-05 13:02:10 -06:00
Joakim Erdfelt d7dd68d6e9 Updating to version 9.3.28.v20191105 2019-11-05 11:46:40 -06:00
Joakim Erdfelt b17439c731 Updating to version 9.2.30-SNAPSHOT 2019-11-05 11:23:21 -06:00
Joakim Erdfelt 36c95fdd43 Updating to version 9.2.29.v20191105 2019-11-05 10:43:15 -06: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
Greg Wilkins ce41c122a6
Issue #4176 setHeader after sendError (#4181)
* Issue #4176 setHeader after sendError

SendError now makes the response immutable for headers and status.

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

* Issue #4176 setHeader after sendError

cleanup after review
better names

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

* Issue #4176 setHeader after sendError

better name

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

* Issue #4176 setHeader after sendError

even better name

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-10 19:35:28 +11:00
Greg Wilkins faac5d7f04 Issue #4179 SendCallback GC
The HttpConnection.SendCallback nulls it's reference to buffers and callbacks after completion to assist with easy GC, since the connection callback is a long lived instance.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-10 09:09:53 +11:00
Greg Wilkins 31a0180133 Improve debug logging of gzip inflation
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-09 11:51:13 +11:00
Greg Wilkins 8087e29211 Reverted getSession(id) to public
This method is used by third party session handlers.
Reverts change made as part of #3913

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-09 11:46:43 +11:00
Simone Bordet 7810f2dec2 Reverted 82a00524d1.
The connection upgrade check is necessary both after the parsing and
after the handling. After the parsing covers HTTP/2 prior knowledge
"PRI * HTTP/2" case; after the handling covers the WebSocket case.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-02 10:18:06 +02:00
Joakim Erdfelt 6fc42d8ba2 Merge branch 'release-9.4.21' into jetty-9.4.x 2019-10-01 13:35:43 -05:00
Simone Bordet a380f6b7b9
Merge pull request #4081 from eclipse/jetty-9.4.x-HttpConnection_UpgradeCheck
Remove unnecessary Connection upgrade check
2019-10-01 18:10:23 +02:00
Joakim Erdfelt 7807eafad9 Updating to version 9.4.22-SNAPSHOT 2019-09-26 10:46:28 -05:00
Joakim Erdfelt 72970db61a Updating to version 9.4.21.v20190926 2019-09-26 09:59:15 -05:00
Greg Wilkins 11b60db4c3
Issue #4047 Graceful Write (#4100)
Added test to reproduce issue
Fixed bug from #2772 where output was shutdown on DONE without checking for END.
Fixed aggregation logic to aggregate last write if aggregation already started
Improved comments and clarify conditions

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-09-25 12:13:56 +10:00
Simone Bordet f85382aa9d
Merge pull request #4086 from eclipse/jetty-9.4.x-1036-SchedulerThreads
Issue #1036 Configure Scheduler
2019-09-17 11:37:23 +02:00
Lachlan Roberts a0cd331327 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-9.4.x-HttpConnection_UpgradeCheck 2019-09-17 13:11:43 +10:00
Greg Wilkins bcf6b4c581 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-9.4.x-1036-SchedulerThreads 2019-09-17 12:36:23 +10:00
Simone Bordet 422b9bded5 Fixes #3747 - Make Jetty Demo work with JPMS.
Introduced module `jdbc` and made other modules that require JDBC depend on it.
Modified demo.ini to enable the `jdbc` module because some webapp descriptor
of the demo requires JDBC classes.

Now the demo can be run fine on the module-path just by adding --jpms.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-16 22:57:55 +02:00
Joakim Erdfelt 39c230f294
Merge pull request #4083 from eclipse/jetty-9.4.x-97-Unavailable
Issue #97 ServletHolder unavailable handling
2019-09-13 09:58:09 -05:00
Greg Wilkins ae0ab46066 Issue #97 Unavailable handling
Added test for servlet component lifecycle
Fixed bug where we were destroying listeners before calling them.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-09-13 11:40:11 +10:00
Greg Wilkins 92e4d73dcb Issue #1036 Configure Scheduler
Allows scheduler configuration

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-09-13 09:52:28 +10:00
Lachlan Roberts 82a00524d1 remove unnecessary connection upgrade check
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-09-12 10:52:06 +10:00
Greg Wilkins 905bf82f80 reformatting
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-09-12 10:14:58 +10:00
Joakim Erdfelt 43e10f8a5e
Merge pull request #4056 from eclipse/jetty-9.4.x-testing-embedded-examples
Unit Testing the Embedded Examples
2019-09-11 09:20:10 -05:00
Jan Bartel a563cdca76
Issue #4025 Add flushOnResponseCommit mode to sessions. (#4049)
* Issue #4025 Add flushOnCommit mode to sessions.

Added flushOnCommit mode to write a session to the backing store as the
response commits, before any bytes are returned to the client.

Signed-off-by: Jan Bartel <janb@webtide.com>
2019-09-11 09:10:35 +10:00
Greg Wilkins 17f4dd1a40
Merge pull request #4066 from dreis2211/tolerate-multiple-accept-encondings-gziphandler
Tolerate multiple Accept-Encoding headers in GzipHandler
2019-09-09 15:14:15 +10:00
dreis2211 82e8fc0b0e Simplify check for Accept-Encoding header
Signed-off-by: dreis2211 <christoph.dreis@freenet.de>
2019-09-09 07:06:40 +02:00
tomoya yokota c904a14d6a fix Session#finishInvalidate throwsConcurrentModificationException (#4036)
* fix Session#finishInvalidate throws java.util.ConcurrentModificationException
* Change constructor _attribute field must assigned to ConcurrentHashMap

Signed-off-by: tomoya-yokota <tomoya-yokota@cybozu.co.jp>
2019-09-09 14:52:48 +10:00
dreis2211 597458df7c Tolerate multiple Accept-Encoding headers in GzipHandler
Signed-off-by: dreis2211 <christoph.dreis@freenet.de>
2019-09-08 01:44:05 +02:00
Joakim Erdfelt 7618eae915 Issue #4064 - MinimalServlets test and ServletHolder fix
+ Also made ContextHandler warning message about features
  that are unimplemented (and you should use ServletContextHandler)
  more clear. (this helped with diagnosing where the bug was
  in ServletHolder)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-09-06 09:26:06 -05:00
Greg Wilkins 894f31e612
Issue #4048 Multiple proxy ports (#4063)
Support multiple proxy port values.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-09-06 14:45:00 +10:00
康智冬 3a6b26d292 fix typo (#4055)
Signed-off-by: KangZhiDong <worldkzd@gmail.com>
2019-09-05 13:17:30 -04:00
康智冬 49ba6d1acb fix typo and grammar (#4045)
Signed-off-by: KangZhiDong <worldkzd@gmail.com>
2019-09-02 14:29:50 -04:00
Joakim Erdfelt 2fcb311c56 Issue #4033 - Addressing Lenient URIUtil decode behavior change in test
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-28 16:32:19 -05:00
Jan Bartel 37712d75a2
Issue #4027 Ensure AbstractSessionDataStore started or throws exception. (#4028)
* Issue #4027 Ensure AbstractSessionDataStore started or throws exception.

Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-28 11:08:42 +10:00
Jan Bartel a2fc9b113b Fix and enhance session invalidation tests.
Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-28 11:04:31 +10:00
Joakim Erdfelt eef2481b59 Adding cookie parsing test for excessive semicolon (reported as CVE in other projects) 2019-08-27 14:09:06 -05:00
Greg Wilkins 2564a08150 fix checkstyle
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 18:43:33 +10:00
Greg Wilkins 83463c2a23
Issue #3964 - Listener behavior cleanup (Jetty 9.4.x) (#3965)
Issue #3964
* Avoid creating listener list for rarely used requestAttributeListener
* AbstractConnector keeps a specific list of HttpChannel.Listeners
to avoid Connection.Listeners and MBean listeners being added to
the HttpChannel listener list.
* Simplified listener handling by avoiding null connector, previously
only needed for testing.
* Fixed test that assumed HttpChannel listeners were not cleared by a recycle
* Separated out durable vs cyclic HttpChannel.Listeners, so as to
simplify handling.
* Deprecated cyclic HttpChannel.Listeners, as I'm not sure the channel is
the right place for them.
* Added improved method to combine multiple HttpChannel Listeners
into a single Listener.
* Fixed MockConnector
* Added benchmark
* Improved benchmark
* Updates from review
* Removed benchmark and alternate implementations.
* Updated javadoc
* Updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 17:38:20 +10:00
Olivier Lamy b51d770807
session#getLastAccessedTime should throw IllegalStateException if session has been invalidated (#4023)
* per servlet api javadoc getLastAccessedTime should throw IllegalStateException if session has been invalidated

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

* isInvalid test should be done within lock

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-27 13:03:28 +10: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 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
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
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
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
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 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
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
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
Joakim Erdfelt 1254f6eb67 Issue #3985 - Fixing RequestTest
+ Moving overly bad cookie to CookieCutter_LenientTest
+ Changing expectation in RequestTest.testCookie()

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-16 15:57:26 -05:00
Joakim Erdfelt fba010d33d Issue #3985 - Updates to CookieCutter to reject no-equal cookies
* If a cookie has no value it is rejected and not stored.
  - `name` is rejected
  - `name=` is accepted, with empty value

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-16 13:11:40 -05:00
Joakim Erdfelt eaf2263053 Issue #3985 - Testcase for CookieCutter parsing issue of bad cookie
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-15 17:58:53 -05:00
Joakim Erdfelt 50b524bb6b Merge branch `release-9.4.20` into `jetty-9.4.x` 2019-08-15 07:27:25 -05:00
Jan Bartel af6c675023
Issue #3913 Fix races in session request reference counting (#3947)
* Issue #3913 Fix races in session request reference counting

Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-15 12:27:18 +10:00
Joakim Erdfelt f1efc99918 Updating to version 9.4.21-SNAPSHOT 2019-08-13 17:34:20 -05:00
Joakim Erdfelt 84700530e6 Updating to version 9.4.20.v20190813 2019-08-13 16:13:21 -05:00
Joakim Erdfelt fec01a4628 Fixes #3969 - Changing TYPE to class from PR review
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-13 16:00:18 -05:00
Joakim Erdfelt 3940baea9c Fixes #3969 - Adding comments from PR review
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-13 15:56:11 -05:00
Joakim Erdfelt 72c05bc8ba Fixes #3969 - Fixing X-Forwarded-Port header setter
+ Fixing ForwardedRequestCustomizer.getForwardedPortHeader()
+ Fixing ForwardedRequestCustomizer.setForwardedPortHeader(String)
+ Refactoring unit tests:
  + Tests default ForwardedRequestCustomizer behavior
    on one Connector
  + Tests header configured ForwardedRequestCustomizer behavior
    on different Connector

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-13 12:39:30 -05:00
Joakim Erdfelt d10fea9b7e
Merge pull request #3970 from eclipse/jetty-9.4.x-3969-xforwarded-host
Issue #3969 - adding testcase to verify Host & X-Forwarded behavior
2019-08-13 09:16:08 -05:00
Joakim Erdfelt 4b17d28cb0 Issue #3969 - adding testcase to verify behavior
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-13 07:30:14 -05:00
Lachlan d3bc0b931a
Issue #3957 - fix bad usage of MethodHandles.lookup() (#3962)
* Issue #3957 - fix bad usage of MethodHandles.lookup()

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

* Issue #3957 CustomRequestLog remove unnecessary local string variables

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-08-13 14:47:39 +10:00
Simone Bordet 46e1896322 Fixes #3960 - Fix HttpConfiguration copy constructor.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-12 17:42:54 +02:00
Olivier Lamy 503a52273e
Jetty 9.4.x fix some part of the code assuming cast to HttpServletRequest is possible (#3945)
* code assume request is HttpServletRequest whereas it can be ServletRequestWrapper, this fix some failing tck tests

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

* return directly if the instance is already HttpServlet*Wrapper

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

* checkstyle

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

* changes after review

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

* checkstyle

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

* checkstyle and cleanup import

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-08 20:46:19 +10:00
Simone Bordet 2e2cde69e9
Merge pull request #3899 from eclipse/jetty-9.4.x-3856-maxForm_contentLength_behavior
Fixes #3856 - Different behaviour with maxFormContentSize=0 if Content-Length header is present/missing.
2019-08-07 19:46:49 +03:00
Simone Bordet 632c916608 Fixes #3856 - Different behaviour with maxFormContentSize=0 if Content-Length header is present/missing.
Removed duplicated, unused, code.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-07 17:35:10 +02:00
Simone Bordet 8418f56e94 Fixes #3856 - Different behaviour with maxFormContentSize=0 if Content-Length header is present/missing.
Changed the logic to lookup server attributes if there is no context.
This fixes a failing test that was explicitly setting the server
attributes after start.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-02 22:05:07 +02:00
Simone Bordet 2488c9611f Merged branch 'jetty-9.4.x' into 'jetty-9.4.x-3856-maxForm_contentLength_behavior'. 2019-08-02 19:13:35 +02:00
Simone Bordet 42815a781b Fixes #3856 - Different behaviour with maxFormContentSize=0 if Content-Length header is present/missing.
Updated code to reflect reviews.
Now lookup of system properties and server attributes is done in
ContextHandler.doStart(), so that the getter always return the
actual value (and this is good for JMX too).

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-02 19:12:49 +02:00
Joakim Erdfelt c2f76a6be5 Issue #3906 - Handling SeekableByteChannel.setPosition() Exception
+ UnsupportedOperationException now triggers a fallback seek mode

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-31 14:36:16 -05:00
Joakim Erdfelt 95298d89e9
Merge pull request #3910 from eclipse/jetty-9.4.x-3840-pathresource-byterange
Issue #3840 Static resource byte-range support performance
2019-07-30 20:04:06 -05:00
Joakim Erdfelt dc4b7b1791
Merge pull request #3889 from eclipse/jetty-9.4.x-3888-huge-resources
Issue #3888 - Huge file Resources behaviors
2019-07-30 20:03:34 -05:00
Joakim Erdfelt 602c44ec96 Issue #3888 - Adding comment from PR review
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-30 20:02:18 -05:00
Joakim Erdfelt 7a867c0ff0 Issue #3840 - Applying ByteBuffer niggle from PR review
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-30 19:59:49 -05:00
Joakim Erdfelt ed8d9cabff Issue #3840 - Simplifying ResourceService
+ Removing unnecessary variables (per PR review)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-30 17:12:38 -05:00
Joakim Erdfelt b2ec6dd1af Issue #3840 - Fixing for InputStream.skip() behaviors
+ Reset progress on any positive skip value
+ Throw IOException(EOF) for any negative skip value

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-30 17:11:27 -05:00
Joakim Erdfelt 5129f2c9ff Issue #3840 - InputStream.skip() rules must be followed
+ break out if progress isn't made, loop if not enough
  progress is made

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-30 13:00:03 -05:00
Gili Tzabari 33bd4e6bc0 Updated PR in response to comments.
Signed-off-by: Gili Tzabari <cowwoc2020@gmail.com>
2019-07-30 12:50:45 -04:00
Gili Tzabari d3cbd36fe0 Added Javadoc.
Signed-off-by: Gili Tzabari <cowwoc2020@gmail.com>
2019-07-30 11:46:30 -04:00
mpe85 bb639817a3 Made loading of blobs from database more robust (#3895)
Signed-off-by: mpe85 <marco.perazzo85@gmail.com>
2019-07-29 14:33:40 +10:00
Joakim Erdfelt e5bce5f7cd Issue #3840 - Static resource byte-range support performance
+ Reverting toFile().getInputStream() on PathResource
+ Adding RangeWriter concept for managing open resource
  across multiple range writes
+ RangeWriter implementation delegates to HttpContent behaviors
  Lookup is :
  - Direct Buffer
  - Indirect Buffer
  - ReadableByteChannel (as SeekableByteChannel)
  - InputStream
+ Adding unit tests for all RangeWriter implementation to ensure
  that they behave the same way everywhere.
+ Making ResourceService use new RangeWriter implementation
+ Existing DefaultServletRangeTest still works as-is

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-26 12:36:31 -05:00
Joakim Erdfelt 9e90c60f0e Issue #3888 - Fixing implementation of CachedContentFactory
+ ResourceCacheTest identified a bug in CachedContentFactory
  (a bad/reversed if statement)
+ Updated ResourceCacheTest to not rely on jetty-util src/test/resources

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-24 11:26:49 -05:00
Joakim Erdfelt 6fd8aeefde Issue #3888 - Adding HttpClient tests
+ Also applying changes from review

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-23 15:24:33 -05:00
Simone Bordet 2629961e74 Fixes #3856 - Different behaviour with maxFormContentSize=0 if Content-Length header is present/missing.
Changes after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-07-23 22:01:13 +02:00
Simone Bordet d939c9435a Fixes #3856 - Different behaviour with maxFormContentSize=0 if Content-Length header is present/missing.
Fixed zero checks and exception messages.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-07-23 15:44:08 +02:00
Joakim Erdfelt 446c3d7202 Issue #3888 - Fixing ServletRequest.getContentLength() behavior
+ For Content-Length values exceeding Integer.MAX_VALUE the return
  must be -1.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-19 10:35:35 -05:00
Joakim Erdfelt 8afc4464d5 Issue #3503 - Adding testcases for huge Content-Length behaviors
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-19 10:27:38 -05:00
Joakim Erdfelt f856ad41da Issue #3888 - For Resources exceeding maxCachedFileSize do not allocate
+ Only used Mapped ByteBuffers, ReadableByteChannel, or InputStream

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-19 10:25:04 -05:00
Joakim Erdfelt 36294ef0da Issue #3888 - Fixing for truncated long to int
+ Allowing CachedHttpContent._contentLengthValue actually hold
  the `long` resource size (for the 4G variant on test)
+ Allowing BufferUtil to not throw Exception if resource length
  is a positive value, but exceeds Integer.MAX_VALUE, opting instead
  to return a null to prevent excessive memory usage. (fixes the 10G
  variant of test)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-18 12:13:35 -05:00
Greg Wilkins d71a2d8f7d
Issue #3806 async sendError (minimal fix) (#3875)
* Issue #3806 async sendError

This is a minimal fix for the async race of sendError using isHandled
at the same time as the normal dispatch is exiting.

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

* Issue #3806 async sendError

Fixed isStreaming method in minimal fix (showing the need for actual
test harnesses).

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-07-17 23:25:30 +02:00
Lachlan Roberts 50c18798ba Merge remote-tracking branch 'eclipse/jetty-9.4.x' into jetty-9.4.x-300-CompressionPool
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-07-04 10:19:54 +10:00
Jan Bartel bb7fb48f08
Fix checkstyle warnings for tests. (#3846)
Signed-off-by: Jan Bartel <janb@webtide.com>
2019-07-03 16:42:20 +02:00
Jan Bartel e26179e8e9
Issue #3799 Programmatic listeners from ServletContextListeners. (#3824)
* Issue #3799 Programmatic listeners from ServletContextListeners.

Ensure programmatic listeners added from ServletContextListeners are
called.

Signed-off-by: Jan Bartel <janb@webtide.com>

* Issue #3799 add distribution test

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-07-01 15:14:19 +02:00
Greg Wilkins c94230da40 Issue #3832 Test for proxy protocol v2
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-29 10:04:01 +02:00
Lachlan Roberts 2cf0c8aeb8 Merge remote-tracking branch 'jetty-9.4.x' into jetty-9.4.x-300-CompressionPool
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-06-25 10:21:43 +10:00
Greg Wilkins 9706d70484
Jetty 9.4.x reformat (#3811)
* Removing Legacy Method Separators
* Restyling branch `jetty-9.4.x`
* Applying changes highlighted by checkstyle
* Applying XML restyling
* Fixing XML codestyle for IntelliJ
* Fixing XML style mistakes
* Revert "Applying XML restyling"
* Updating checkstyle for XML codestyle
* Reformatting pom.xml files
* Fixed empty string from line wraps
* Update intellij style to not do expression relative formatting. Reformatted code based on that.
* Increasing line split on Eclipse IDE Formatter to 512
* Restoring setting on internal default value.
+ IntelliJ will not export settings on things that set to their
  internal default values.
  We want to keep those values as a hedge against future default
  value changes in future releases of IntelliJ.
* Fixing intellij codestyle
* do not allow single line simple methods
* misc checkstyle fixes
* re-exported with correct name and all values

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-24 17:40:30 +02:00
Greg Wilkins 862e6d008e
Jetty 9.4.x 3755 annotation/jndi example cleanup (#3763)
* Issue #3755 Annotation example cleanup

+ Created JettyDistribution class as common utility to locate a jetty distribution for examples.
+ Fixed ServerWithAnnotations to correctly use the test-spec-webapp
+ Added AttributeContainerMap as a better way to treat attribute values as beans. This avoids them appearing twice in a dump and always associates them with their key.
+ Added NamingDump and use it in EnvConfiguration and jetty-plus.xml so that a server dump will contain dumps of the server local tree and each contexts java:comp/env tree
+ Improved the dump format of NamingContext and WebAppContext
+ Improved the toString format of several associated classes

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-18 09:50:18 +02:00
Greg Wilkins e7e63a5617 Issue #3782 X-Forwarded-Port can be remote or local
Improved names and javadoc after review.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-17 16:58:20 +02:00
Greg Wilkins 9cf8cf3c0d Issue #3782 X-Forwarded-Port can be remote or local
Added option for X-Forwarded-Port to be remote or local with default
being local.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-17 16:58:20 +02:00
Joakim Erdfelt 345750f9fd Issue #3782 - X-Forwarded-Port refers to node listening port
+ Updating testcases to test requestURL as well.
+ Adding new testcases for X-Forwarded-Port modifying only
  the port of an existing `Host:` header.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-17 16:58:20 +02:00
Joakim Erdfelt a1fe57a654 Issue #3782 - updating existing testcases
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-17 16:58:20 +02:00
Joakim Erdfelt 2f3eed8604 Issue #3782 - reducing noise during testing
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-17 16:58:20 +02:00
Joakim Erdfelt f05d6cf9ad Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-9.4.x-300-CompressionPool 2019-06-14 08:38:08 -05:00
Joakim Erdfelt 40e9e053b9
Merge pull request #3768 from eclipse/jetty-9.4.x-3708-stringutil-replace
Issue #3708 - use StringUtil alternatives for known slow JVM impls.
2019-06-13 14:01:35 -05:00
Joakim Erdfelt 877815e195 Issue #3708 - Adding new methods and converting codebase to use them
+ StringUtil.replace(String, char, char)
+ StringUtil.strip(String, String)
+ URIUtil.encodeSpecific(String, String)
+ URIUtil.decodeSpecific(String, String)
+ TypeUtil.toClassReference(Class)
+ TypeUtil.toClassReference(String)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-12 09:56:41 -05:00
Lachlan Roberts e8115268d4 Issue #300 - rework of inflater and deflater pools
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-06-12 14:21:40 +10:00
Joakim Erdfelt 33fe55c339 Issue #3708 - use StringUtil alternatives for known slow JVM impls.
+ StringUtil.replace()
+ StringUtil.replaceFirst()
+ StringUtil.sanitizeFileSystemPath()

Change existing usages of String.replace() to either
use new StringUtil.replace() or other methods elsewhere
that better suit that specific need.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-11 11:25:50 -05:00
Joakim Erdfelt ae21126cad Updating to version 9.4.20-SNAPSHOT 2019-06-10 13:40:17 -05:00
Joakim Erdfelt afcf563148 Updating to version 9.4.19.v20190610 2019-06-10 11:17:56 -05:00
Lachlan Roberts e75ca325fd Issue #3683 - close part if failure occurs in MultiPartFormInputStream
parameterize MultiPartServletTest over compliance modes

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-06-04 12:03:24 +10:00
Lachlan Roberts 17b8eb8401 Issue #3683 - ensure multipart files are still cleaned up after errors
- do not parse MultiParts in constructor so the attribute can be set
- deleteParts in MultiPartFormInputStream from _parts MultiMap
- only add the MultiPartCleanerListener once per context

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-06-04 11:19:42 +10:00
Simone Bordet 5ebd6d4ad2
Merge pull request #3682 from eclipse/jetty-9.4.x-3681-HttpFieldsOptimize
Jetty 9.4.x 3681 http fields optimize
2019-06-03 16:51:58 +02:00
Jan Bartel dec10044e0
Jetty 9.4.x 3722 session destroy listeners (#3723)
* Issue #3722 Use webapp classloader for HttpSessionListener.sessionDestroyed calls
2019-06-03 10:27:38 +02:00
Greg Wilkins cf9c238721 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-9.4.x-3681-HttpFieldsOptimize 2019-05-26 16:18:13 +02:00
Greg Wilkins 53dc425bde Issue #3681
updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-23 12:33:35 +02:00
Olivier Lamy f2c59a3cb7
add convenient StringUtil isEmpty method (#3687)
* add StringUtil.isEmpty

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-05-23 09:01:36 +10:00
Greg Wilkins 4dc004cf96 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-9.4.x-3681-HttpFieldsOptimize
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-22 23:26:48 +02:00
Greg Wilkins 26169491c9 Issue #3655 simplifications of Cookie handling
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-22 23:10:12 +02:00
Joakim Erdfelt 2de5456790 Issue #3655 - Fixing javadoc
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-05-22 23:10:12 +02:00
Joakim Erdfelt 5d267963a3 Issue #3655 - Cookie generation now complies with RFC6265 spaces
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-05-22 23:10:12 +02:00
Greg Wilkins 2ba0c7bb79 Issue #3681
cacheContent type and avoid unnecessary character encoding calculations

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-22 14:12:52 +02:00
Greg Wilkins 70311fe987 Issue #3681
minor cleanups

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-22 14:02:38 +02:00
Michael Hausegger 1e84a04682 Removed blank
Signed-off-by: Michael Hausegger <hausegger.michael@googlemail.com>
2019-05-22 08:27:53 +02:00
Michael Hausegger e8f11d3c7e Added small performance improvements
Signed-off-by: Michael Hausegger <hausegger.michael@googlemail.com>
2019-05-22 08:27:53 +02:00
Jan Bartel 671d1cb2b8
Issue #3653 Ensure custom SecurityManager.checkPermission is used. (#3654)
* Issue #3653 Ensure custom SecurityManager.checkPermission is used.
2019-05-17 16:28:42 +02:00
Greg Wilkins cec50b3d2c Issue #3630 Optimized ForwardedRequestCustomizer
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-14 17:08:01 +02:00
Greg Wilkins 9f3b0223ab Issue #3630 Forwarded-Port
reformatted code
Avoid updating handles unless configuration is changed.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-14 17:08:01 +02:00
Greg Wilkins 05072b34dc Issue #3630 Forwarded-Port
Added support for the X-Forwarded-Port header.
Reimplemented header scanning using more efficient Trie and MethodHandles

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-14 17:08:01 +02:00
Simone Bordet 7d52a6957b Fixes #3633 - endpointIdentificationAlgorithm enabled by default jetty-ssl-context.xml.
Updated *.xml and *.mod to reflect the right default (null), rather than "HTTPS".

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-05-07 16:46:34 +02:00
Greg Wilkins 6c6646286d cleanup after review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-03 15:25:05 +02:00
Greg Wilkins 45270814d1 removed unused class
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-03 15:25:05 +02:00
Greg Wilkins 604f2379bd cleanup dumps from review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-03 15:25:05 +02:00
Greg Wilkins aafb0fcec1 simplification after review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-03 15:25:05 +02:00
Greg Wilkins feb0333844 Fixed IncludeExclude combination logic
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-03 15:25:05 +02:00
Greg Wilkins 8b5f0211a8 parameterize include and exclude
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-03 15:25:05 +02:00
Nicholas DiPiazza e4471ca77a Format source and add license header
Signed-off-by: Nicholas DiPiazza <nicholas.dipiazza@lucidworks.com>
2019-05-03 15:25:05 +02:00
Nicholas DiPiazza 1f4189eb19 Addresses #3562
## Ports the `ipaccess` being added as a module from jetty 10

you can now do `java -jar start.jar --add-to-start=inetaccess` to add
the inetaccess handler to your jetty config.

## Allows you to specify a list of connector names that the
`InetAccessHandler` applies to

This is important for those who run jetty using `start.jar` to make it
possible to do things like have an open HTTPS connector but a whitelist
restricted HTTP connector.

Example:

`etc/jetty-inetaccess.xml`

```
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
"http://www.eclipse.org/jetty/configure_9_3.dtd">

<Configure id="Server" class="org.eclipse.jetty.server.Server">
    <Call name="insertHandler">
        <Arg>
            <New id="InetAccessHandler"
class="org.eclipse.jetty.server.handler.InetAccessHandler">
                <Call name="exclude"><Arg>127.0.0.128-127.0.0.129</Arg></Call>
                <Call name="includeConnectorName"><Arg>http</Arg></Call>
            </New>
        </Arg>
    </Call>
</Configure>
```

You can now
`java -jar start.jar --add-to-start=https`
and
`java -jar start.jar --add-to-start=inetaccess`

And you can now choose what inetaccess handler rules apply to http
versus https.

## Adds a basic `InetAccessHandler` Unit Test

Cover a few of the basic features of InetAccessHandler so it can have
some coverage.

Signed-off-by: Nicholas DiPiazza <nicholas.dipiazza@lucidworks.com>
2019-05-03 15:25:05 +02:00
Joakim Erdfelt 41ab9baf8c Standardizing on hamcrest Matchers (not CoreMatchers from junit4)
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-04-30 14:39:57 -05:00
Joakim Erdfelt 112d08259d Migrating away from hamcrest deprecated matchers
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-04-30 13:21:54 -05:00
Joakim Erdfelt e33dfabba9 Moving to IPv6 Assumption (from junit Group/Tag)
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-04-30 12:26:14 -05:00
Joakim Erdfelt 734be56938 Updating to version 9.4.19-SNAPSHOT 2019-04-29 16:27:23 -05:00
Joakim Erdfelt e1bc35120a Updating to version 9.4.18.v20190429 2019-04-29 15:40:33 -05:00
Jan Bartel ab174d1015
Issue #3597 Fix session persistence classloading for deep structures (#3602)
* Issue #3597 Fix session persistence classloading for deep structures with system classes.
2019-04-29 12:05:34 +02:00
Joakim Erdfelt 29b960551f Merge branch `release-9.4.17` into `jetty-9.4.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-bom/pom.xml
2019-04-25 09:15:42 -05:00
olivier lamy 8bacb603a7 default handler is now HTML5 compliant so default character encoding is now UTF-8
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-04-23 12:59:47 +10:00
Joakim Erdfelt 05bb111580 Updating to version 9.4.18-SNAPSHOT 2019-04-18 15:59:49 -05:00
Joakim Erdfelt aa1c656c31 Updating to version 9.4.17.v20190418 2019-04-18 14:44:28 -05:00
Joakim Erdfelt 5882d63ba7 Updating to version 9.3.28-SNAPSHOT 2019-04-18 13:54:17 -05:00
Joakim Erdfelt d3e249f869 Updating to version 9.3.27.v20190418 2019-04-18 13:10:03 -05:00
Joakim Erdfelt 2c14d93885 Updating to version 9.2.29-SNAPSHOT 2019-04-18 12:17:07 -05:00
Joakim Erdfelt 1dffa36fe3 Updating to version 9.2.28.v20190418 2019-04-18 11:23:17 -05:00
Joakim Erdfelt c75136fe63 Merge branch 'release-9.4.16' into jetty-9.4.x 2019-04-18 10:13:20 -05:00
Jan Bartel b6809f5555
Jetty 9.4.x 2140 infinispan expired sessions (#3457)
Infinispan and hazelcast changes to scavenge zombie expired sessions.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Jan Bartel <janb@webtide.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-04-18 17:24:25 +10:00
Joakim Erdfelt 2995029c98 Merge branch `jetty-9.3.x` into `jetty-9.4.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
#	jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientURITest.java
#	jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/AbstractHttpClientServerTest.java
#	jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/HttpClientTest.java
#	jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ConnectHandlerTest.java
#	jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java
#	jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DefaultServletTest.java
#	jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java
#	pom.xml
2019-04-17 17:10:53 -05:00
Joakim Erdfelt 3ab1ea3181 Merge branch `jetty-9.2.x` into `jetty-9.3.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
#	jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientURITest.java
#	jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/AbstractHttpClientServerTest.java
#	jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/HttpClientTest.java
#	jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ConnectHandlerTest.java
#	jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java
#	jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DefaultServletTest.java
#	jetty-spdy/spdy-http-client-transport/src/test/java/org/eclipse/jetty/spdy/client/http/HttpClientTest.java
#	jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java
#	pom.xml
2019-04-17 16:47:15 -05:00
Joakim Erdfelt a15534d72c Issue #3555 - Applying more changes from review
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-04-17 16:36:33 -05:00
Joakim Erdfelt b0f72a87d5 Issue #3555 - Applying more changes from review
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-04-17 12:16:18 -05:00
Joakim Erdfelt 5ef8a8abfa Issue #3555 - Applying more changes from review
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-04-17 10:51:05 -05:00
Joakim Erdfelt 99f3926d05 Issue #3555 - Applying changes from review
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-04-16 14:49:03 -05:00
Joakim Erdfelt d983890d17 Issue #3555 - DefaultHandler output cleaned up.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-04-16 13:28:57 -05:00
Joakim Erdfelt 6d847d4a73 Issue #3555 - DefaultHandler output is now HTML5 compliant.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-04-16 12:02:15 -05:00
Joakim Erdfelt 9f506e4123 Issue #3555 - Do not reveal base resource in error response
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-04-15 18:24:35 -05:00