Commit Graph

1228 Commits

Author SHA1 Message Date
Greg Wilkins 7f96db72c4 Issue #448 - RFC2616 Compliance Mode should track and report RFC7230 violations
Empty value is not a compliance issue
removed debug
moved violation handling to end of header rather than end of message
2016-03-23 13:13:16 +11:00
Joakim Erdfelt 0e2472b8e1 Issue #451 - RFC2616 Compliance mode should support empty headers
Updating test cases to show empty quoted header quirk
2016-03-22 11:20:50 -07:00
Greg Wilkins 9352d91d48 Issue #448 Log Compliance violations
Added a ComplianceHandler to HttpParsere to log compliance violations for #448
Am cautious that this may have a performance impact.
2016-03-22 13:58:50 +11:00
Joakim Erdfelt c68d3b1d8d Updating to version 9.3.9-SNAPSHOT 2016-03-14 09:07:52 -07:00
Joakim Erdfelt 1f3b3f31f4 Updating to version 9.3.8.v20160314 2016-03-14 08:30:20 -07:00
Simone Bordet 838b5e4df2 Added test for newlines in header value. 2016-03-14 12:32:20 +01:00
Simone Bordet c583054a17 Code cleanup. 2016-03-14 12:31:28 +01:00
Simone Bordet 0b82129cd8 Issue #423 (Duplicate Content-Length header not handled correctly)
Refactored tests into existing test class.
2016-03-12 00:27:48 +01:00
Simone Bordet 5f2e2820f4 Issue #423 (Duplicate Content-Length header not handled correctly)
Fixed as required by the spec, rejecting the request.
2016-03-11 22:49:24 +01:00
Joakim Erdfelt 862ec6f848 Merge branch 'jetty-9.2.x' into jetty-9.3.x 2016-03-08 14:32:04 -07:00
Joakim Erdfelt 07d54224c7 Issue #405 - adding testcase for problematic HttpURI parsing of path params 2016-03-07 17:12:05 -07:00
Joakim Erdfelt 2cc50ed925 Issue #316 - Add *.chm mimetype mapping 2016-03-07 16:32:36 -07:00
Greg Wilkins 10bd934476 Issue #346 HttpParser RFC2616 Compliance mode
Empty header values returned as "" in all compliance modes
2016-03-05 14:26:47 +01:00
Greg Wilkins d1fc5eb67d Revert "Issue #346 HttpParser RFC2616 Compliance mode"
This reverts commit 58e5a54ab6.
RFC7430 allows empty header values
2016-03-05 11:03:32 +01:00
Greg Wilkins 58e5a54ab6 Issue #346 HttpParser RFC2616 Compliance mode
Ignore headers without values.
2016-03-05 11:03:11 +01:00
Greg Wilkins f4453ba5e0 Issue #346 HttpParser RFC2616 Compliance mode
Headers with no value return "" in <= RFC2616 mode
2016-03-05 09:21:34 +01:00
Greg Wilkins 1eeecdaee5 Issue #355 Improve close behaviour
Inverted the logic of the handling of exceptions thrown in CommitCallback.
Now only if a BadMessageException is throw do we attempt to write a 500 response.
All other exceptions just abort the connection
2016-02-24 13:36:06 +01:00
Greg Wilkins c3a54e9d0b fixed javadoc 2016-02-23 18:23:23 +01:00
Greg Wilkins 3c671aa8b6 Issue #346 HttpParser RFC2616 Compliance mode
Reimplmented HTTP/0.9 support in RFC2616 compliance mode
2016-02-23 17:33:53 +01:00
Greg Wilkins 27585d923c Issue #346 HttpParser RFC2616 Compliance mode
removed System Property for compliance
2016-02-19 12:14:06 +01:00
Greg Wilkins 72edbe5cea Issue #346 HttpParser RFC2616 Compliance mode
Added RFC2616 compliance mode that allows wrapped headers
2016-02-19 11:22:52 +01:00
Greg Wilkins fd5b3a8062 487714 - Avoid NPE in close race for async write
The race has not been solved, as with lock-free style it is difficult to prevent a
close racing with a write in progress. Instead, the code has been made more
resiliant to such state changes and exceptions thrown are converted to IOExceptions.
2016-02-16 10:06:25 +01:00
Simone Bordet 26b6c848f3 Issue #80 (Spin loop in case of HTTP/2 prefaces without H2C).
Fixed by changing the state of the parser before calling the parser
handler callbacks, and by closing the parser if the upgrade to HTTP/2
is not successful.
2016-02-15 20:50:22 +01:00
Greg Wilkins 6a9002991a Issue #79 Parse HTTP request target starting with //
Added a new parseRequestTarget method
2016-02-15 19:40:10 +01:00
Joakim Erdfelt f98dde5e5b Updating to version 9.2.16-SNAPSHOT 2016-02-10 15:36:41 -07:00
Joakim Erdfelt 9b6890d3c1 Updating to version 9.2.15.v20160210 2016-02-10 14:49:12 -07:00
Simone Bordet 6306f06e2f Merged branch 'jetty-9.2.x' into 'jetty-9.3.x'. 2016-02-09 18:12:04 +01:00
Simone Bordet 145e4bee71 487511 - Jetty HTTP won't work on turkish systems.
Fixed usages of toLowerCase() and toUpperCase() to use Locale.ENGLISH.
2016-02-09 17:50:26 +01:00
Greg Wilkins f2e71a2dde 485306 - HttpParser (HttpURI) mistaking basic auth password as a port number
Added support for a password and a getUser() method
2016-02-03 14:28:08 +01:00
Joakim Erdfelt e0ce545ad7 Updating to version 9.3.8-SNAPSHOT 2016-01-15 17:15:14 -07:00
Joakim Erdfelt c0b191119b Updating to version 9.3.7.v20160115 2016-01-15 16:40:15 -07:00
Joakim Erdfelt b7f9c9aca9 Updating to version 9.3.7-SNAPSHOT 2016-01-13 08:21:01 -07:00
Joakim Erdfelt 21ca3f6690 Updating to version 9.3.7.RC1 2016-01-13 07:30:24 -07:00
Joakim Erdfelt cd39fd84fe Happy New Year 2016 2016-01-04 14:31:22 -07:00
Joakim Erdfelt b5db18378d Happy New Year 2016 2016-01-04 14:21:26 -07:00
Greg Wilkins 19d6e36ab9 484657 - Support HSTS rfc6797 2015-12-23 17:15:24 +11:00
Greg Wilkins 5cd676581c 484622 - Improve handling of Direct and Mapped buffers for static content
ResourceHttpContent now applies a maxBufferSize that is passed through the call to getContent
ResourceCache now accounts for the exact memory usage of content, which may have an indirect
buffer plus either a direct or mapped buffer.  Thus content size may be 0, 1 or 2 times the
file size.

Some more limited unit tests
2015-12-18 12:36:27 +11:00
Joakim Erdfelt 3bec195d08 484440 - Swap WebSocket PathMappings for new jetty-http PathMappings
+ Deprecated jetty-server ServletPathSpec and RegexPathSpec
+ Moved all other code to using new jetty-http versions
2015-12-17 11:42:27 -07:00
Joakim Erdfelt 7c5bec1b48 Using Java 8 Predicate Function
+ Removing jetty-util (java 7) holdover Predicate.java
+ Converting use to (java 8) java.util.function.Predicate
2015-12-17 10:15:57 -07:00
Joakim Erdfelt 343aa066ae Merge branch 'jetty-9.2.x' into jetty-9.3.x
Conflicts:
	jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java
	jetty-http/src/main/java/org/eclipse/jetty/http/PathMap.java
	jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractJettyMojo.java
	jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/WarPluginInfo.java
	jetty-rhttp/jetty-rhttp-gateway/src/main/java/org/eclipse/jetty/rhttp/gateway/Main.java
	jetty-security/src/main/java/org/eclipse/jetty/security/PropertyUserStore.java
	jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java
	jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java
	jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/CompressedResponseWrapper.java
	jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHandler.java
	jetty-util/src/main/java/org/eclipse/jetty/util/IncludeExclude.java
	jetty-util/src/main/java/org/eclipse/jetty/util/RegexSet.java
	jetty-util/src/test/java/org/eclipse/jetty/util/IncludeExcludeTest.java
	jetty-util/src/test/java/org/eclipse/jetty/util/ssl/SslContextFactoryTest.java
2015-12-16 12:56:13 -07:00
Joakim Erdfelt e6901b2646 484349 - Promote WebSocket PathMappings / PathSpec to Jetty Http
+ More testing, more improvements
2015-12-16 11:06:17 -07:00
Joakim Erdfelt 4f9d785b46 Revert "482042 - New API, Allow customization of ServletHandler path mapping"
This reverts commit 77d4b54082.
2015-12-16 10:08:02 -07:00
Joakim Erdfelt 6e0ad429d9 484350 - Allow GzipHandler path include/exclude to use regex
+ Overhauled IncludeExclude to use java 8 predicate
+ Introduced PathSpecSet to standardize path IncludeExclude
+ GzipHandler now uses PathSpecSet for paths

Conflicts:
	jetty-http/src/main/java/org/eclipse/jetty/http/PathMap.java
	jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHandler.java
	jetty-util/src/main/java/org/eclipse/jetty/util/IncludeExclude.java
	jetty-util/src/main/java/org/eclipse/jetty/util/RegexSet.java
2015-12-15 15:23:29 -07:00
Joakim Erdfelt 77d4b54082 482042 - New API, Allow customization of ServletHandler path mapping
+ Swapping out PathMap for PathMappings in ServletHandler

Conflicts:
	jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java
	jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java
2015-12-15 14:41:37 -07:00
Joakim Erdfelt a52a182369 484349 - Promote WebSocket PathMappings / PathSpec to Jetty Http
+ Moving PathMappings from jetty-websocket to jetty-http
 + Renaming WebSocketPathSpec to UriTemplatePathSpec
 + Improving implementation with knowledge gained from PathMap
   and PathMapTest cases.
2015-12-15 13:57:01 -07:00
Joakim Erdfelt 5e3fbbccd0 Backporting GzipHandler's IncludeExclude configs 2015-12-08 15:51:25 -07:00
Greg Wilkins 3527c6a71b StringUtil.csvSplit(String)
Conflicts:
	jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractJettyMojo.java
	jetty-security/src/main/java/org/eclipse/jetty/security/PropertyUserStore.java
	jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java
	jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushCacheFilter.java
	jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java
	jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java
2015-12-08 14:54:33 -07:00
Greg Wilkins 45350b62c1 483344 - text/csv Mime Type For CSV in mime properties File 2015-12-02 11:11:39 +11:00
Greg Wilkins ee9c57e3ea 482670 - HttpURI wrongly parser URI paths starting with /@ 2015-11-26 11:39:55 +11:00
Greg Wilkins a2c057892e 483039 - HTTP2 Upgrade case sensitivity on Connection header 2015-11-26 07:06:38 +11:00
Greg Wilkins 204591ce82 482855 - Content-Length omitted for POST requests with empty body
Removed HTTP 0.9 support
A few code simplifications
Fixed clients relying on Content-Length headers being ignored
2015-11-25 20:50:59 +11:00
Greg Wilkins ab93529f6d 482855 - Content-Length omitted for POST requests with empty body
fixed merge
2015-11-25 20:50:59 +11:00
Greg Wilkins e78fcb59a4 482855 - Content-Length omitted for POST requests with empty body
An ineligant fix. Will improve in 9.3.x/9.4.x without HTTP 0.9 support.
2015-11-25 20:50:59 +11:00
Greg Wilkins aa85d85510 482855 - Content-Length omitted for POST requests with empty body
An ineligant fix. Will improve in 9.3.x/9.4.x without HTTP 0.9 support.
2015-11-25 14:15:14 +11:00
Joakim Erdfelt edf686fe0a Updating to version 9.3.7-SNAPSHOT 2015-11-06 12:13:00 -07:00
Joakim Erdfelt d737e1c638 Updating to version 9.3.6.v20151106 2015-11-06 11:09:32 -07:00
Joakim Erdfelt ec8f8d3e4f Updating to version 9.2.15-SNAPSHOT 2015-11-06 11:06:48 -07:00
Joakim Erdfelt ecba378f5c Updating to version 9.2.14.v20151106 2015-11-06 10:32:14 -07:00
Greg Wilkins c156f6593c 480162 - Continuations behavior differences due to HttpURI behavior
reverted 3e460dd219
added test clarifications
2015-10-21 15:18:12 +11:00
Joakim Erdfelt dde32787c4 Updating to version 9.3.6-SNAPSHOT 2015-10-12 15:47:37 -07:00
Joakim Erdfelt 29722bd880 Updating to version 9.3.5.v20151012 2015-10-12 15:10:39 -07:00
Joakim Erdfelt 2cce7510e1 Updating to 9.3.5-SNAPSHOT 2015-10-08 17:49:09 -07:00
Joakim Erdfelt 37296bec3c Updating to version 9.3.4.v20151007 2015-10-07 14:58:38 -07:00
Simone Bordet 3201d0acd2 477878 - HttpClient over HTTP/2 doesn't close upload stream.
Clarified the difference between last and consumed in HttpContent.
Fixed HTTP/2 transport to behave correctly in case of last content.
2015-09-25 19:31:40 +02:00
Simone Bordet 8c21871cf0 478021 - Client sending Connection: close does not shutdown output.
Fixed behavior of HttpGenerator to change its persistent also for
requests.

Reworked HttpSenderOverHTTP to send headers via IteratingCallback, so
that multiple generation steps can be made to produce SHUTDOWN_OUT.
2015-09-23 22:23:37 +02:00
Greg Wilkins 99f4ed7352 477737 Improve handling of etags with dynamic and static gzip 2015-09-18 12:30:02 +10:00
Greg Wilkins 2d88fdf386 477278 Refactored DefaultServlet for cached Gzip & Etags
Refactored the DefaultServlet to better handle static gzipped files with etags in the cache.
Required a simplification of always having a HttpContent rather than the prior situation of
having either a Resource or a HttpContent.  So introduced a HttpContent.Factory, of which
the ResourceCache is the normal implementation, but there is also now a ResourceContentFactory
that creates content when there is no cache.

The Gzip resource is now associated with the normal resource, so less lookups are needed.
This also give scope for caching dynamic gzipping in the future.

The GzipHttpContent class has been introduced to send content with the headers of the
uncompress, but content of the compressed resource.
2015-09-17 18:19:58 +10:00
Jesse McConnell 20ffd0dd0b Merge branch 'release-9.3.3' 2015-08-31 13:41:21 -05:00
Joakim Erdfelt 5312f2c0d7 Merge branch 'jetty-9.2.x'
Conflicts:
	jetty-util/src/main/java/org/eclipse/jetty/util/BufferUtil.java
	jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketSession.java
2015-08-27 15:34:45 -07:00
Jesse McConnell 6409366499 [maven-release-plugin] prepare for next development iteration 2015-08-27 10:11:29 -05:00
Jesse McConnell 3086adc965 [maven-release-plugin] prepare release jetty-9.3.3.v20150827 2015-08-27 10:11:21 -05:00
Jesse McConnell f8734f23ce [maven-release-plugin] prepare for next development iteration 2015-08-25 14:10:01 -05:00
Jesse McConnell e9edf4c24b [maven-release-plugin] prepare release jetty-9.3.3.v20150825 2015-08-25 14:09:54 -05:00
Joakim Erdfelt 29c223cd8f Adding testcase for reported 400 Bad request error in jetty-user mailing list 2015-08-13 14:46:10 -07:00
Joakim Erdfelt a3684f7fb8 [maven-release-plugin] prepare for next development iteration 2015-07-30 09:47:57 -07:00
Joakim Erdfelt 798fc8118b [maven-release-plugin] prepare release jetty-9.2.13.v20150730 2015-07-30 09:47:48 -07:00
Joakim Erdfelt 4b3879845d [maven-release-plugin] prepare for next development iteration 2015-07-30 07:02:10 -07:00
Joakim Erdfelt 6b7e9ac4b0 [maven-release-plugin] prepare release jetty-9.3.2.v20150730 2015-07-30 07:02:02 -07:00
Jesse McConnell 4b8a6e584f Merge branch 'release-9.3.1' 2015-07-17 12:10:49 -05:00
Greg Wilkins edc8bae556 472781 - GzipHandler isMimeTypeGzipable() bad logic
Added utility classes:

  IncludeExclude  - handles standard include exclude set
  RegexSet        - A set of regular expressions that have a combined compiled pattern
  PathMap.PathSet - A set of standard path mappings
2015-07-17 16:28:48 +10:00
Greg Wilkins de39bf5227 472781, 472782 Improve GzipHandler Include/Exclude handling
Made a common utility class for include/exclude handling
Use path exclusion rather than mime exclusion for svg
2015-07-17 08:11:11 +10:00
Jesse McConnell 9b790c38ce [maven-release-plugin] prepare for next development iteration 2015-07-14 11:42:34 -05:00
Jesse McConnell b35d32f2b8 [maven-release-plugin] prepare release jetty-9.3.1.v20150714 2015-07-14 11:42:28 -05:00
Simone Bordet 9549001d8c 472422 - Custom status codes result in a NumberFormatException while using http2.
Fixed constructor that was passing the name as the value.
Also other cleanups.
2015-07-11 16:30:05 +02:00
Jesse McConnell 7204707902 [maven-release-plugin] prepare for next development iteration 2015-07-09 12:14:38 -05:00
Jesse McConnell 3b1533673e [maven-release-plugin] prepare release jetty-9.2.12.v20150709 2015-07-09 12:14:30 -05:00
Greg Wilkins 4e3b400550 464741 - HttpFields declares IllegalArgumentException as checked exception 2015-07-08 17:48:39 +10:00
Greg Wilkins 7fbf512b17 471985 NPE in HttpFields.putField
The problem had several aspects:
 * HttpField.add should not let a null entry be added to the fields
 * The putHeaders methods should have checked for a null field before trying to add it
 * But the fundamental problem was the JarFileResource.close was leaving exist==true, so a new entry was never created.
2015-07-08 16:07:37 +10:00
Joakim Erdfelt e8eed798ab Fixing exception message 2015-07-06 14:27:38 -07:00
Greg Wilkins 13ce021e5e 471464 - Parsing issues with HttpURI
Fixed parsing of CONNECT URIs
2015-07-01 15:50:31 +10:00
Greg Wilkins 072d11b75c 471464 - Parsing issues with HttpURI
Some extra test cases
2015-07-01 14:06:08 +10:00
Greg Wilkins dd9e3d8ee9 471464 - Parsing issues with HttpURI
Removed pre-existing lookahead
made {} style more consistent
2015-07-01 13:36:49 +10:00
Greg Wilkins 97e5b86b26 471464 - Parsing issues with HttpURI
Removed authhostport boolean
removed lookahead in start
2015-07-01 13:10:16 +10:00
Joakim Erdfelt f299979989 Fixing javadoc on HttpURI.getPath() 2015-06-30 17:46:09 -07:00
Joakim Erdfelt e7d733bda0 471464 - Parsing issues with HttpURI
+ Updating expectations on HttpURIParseTest
+ Making results of new HttpURI(String) and new HttpURI(URI) consistent
+ Making results of HttpURI parsing consistent with java.net.URI
+ Making output of HttpURI.toString() and java.net.URI.toASCIIString()
  consistent with regards to ssp (scheme specific part) behavior
2015-06-30 17:37:40 -07:00
Joakim Erdfelt f3fe4331c4 471464 - Parsing issues with HttpURI
+ Adding documented and annotated tests cases showing problems
  (Note: some tests are @Ignore'd at the moment)
2015-06-30 10:49:28 -07:00
Joakim Erdfelt b522cf0bd8 471388 - StringIndexOutOfBoundsException when using <c:url> with parameters
+ Cleaning up HttpURITest
+ Creating parameterized HttpURIParseTest from various separate test
  cases in former HttpURITest
  + Currently @Ignored
  + Test Parse from String
  + Test Parse from URI
  + Test Parse result differences with java.net.URI
+ Adding more testcases to demonstrate bug
2015-06-29 17:35:34 -07:00
Greg Wilkins 3e401a62e9 StringUtil.csvSplit(String) 2015-06-19 16:48:53 +10:00
Jesse McConnell 60e45a940e [maven-release-plugin] prepare for next development iteration 2015-06-15 15:34:11 -05:00
Jesse McConnell d3dec8d513 [maven-release-plugin] prepare release jetty-9.2.12.M0 2015-06-15 15:34:03 -05:00