Fix syntax
Submitted by: jailletc36 Backport: r1756862 Introduce StrictURI|UnsafeURI for RFC3986 enforcement Submitted by: wrowe Backport: r1756959 Surpress noise about syntax Submitted by: wrowe Backport: r1756978 Yann is correct, % is distinct from reserved and unreserved Submitted by: wrowe Backport: r1757062 As commented, ensure we don't flag a request as a rejected 0.9 request if we identified any other parsing errors and handle all 0.9 request errors as 400 BAD REQUEST, presuming HTTP/1.0 to deliver the error details. Do not report 0.9 issues as 505 INVALID PROTOCOL because the client apparently specified no protocol, and 505 post-dates the simple HTTP request mechanism. Submitted by: wrowe Backport: r1757065 Rename LenientWhitespace to UnsafeWhitespace and change StrictWhitespace to the default behavior, after discussion with fielding et al about the purpose of section 3.5. Update the documentation to clarify this. This patch removes whitespace considerations from the Strict|Unsafe toggle and consolidates them all in the StrictWhitespace|UnsafeWhitespace toggle. Added a bunch of logic comments to read_request_line parsing. Dropped the badwhitespace list for an all-or-nothing toggle in rrl. Leading space before the method is optimized to be evaluated only once. Toggled the request from HTTP/0.9 to HTTP/1.0 for more BAD_REQUEST cases. Moved s/[\n\v\f\r]/ / cleanup logic earlier in the cycle, to operate on each individual line read, and catch bad whitespace errors earlier. This changes the obs-fold to more efficiently condense whitespace and forces concatinatination with a single SP, always. Overrides are not necessary since obs-fold is clearly deprecated. Submitted by: wrowe Backport: r1757589 Also catch invalid spaces between the URI <> Protocol in StrictWhitespace mode. (matching the test for the Method <> URI) Submitted by: wrowe Backport: r1757593 Correct RFC reference text (link was right) Submitted by: wrowe Backport: r1757711 First survey results, all intrinsicly bad input will be logged at the debug level, no louder. This patch intentionally dodges the Limit* constrained tests since administrators may shoot themselves in the foot, or be confronted with impossibly long cookie values, etc. Adjust the documentation to match. Submitted by: wrowe Backport: r1757920 Correct URL failure reporting. Drop the second reporting of HEAD over HTTP/0.9 requests, we short-circuit this early now in read_request_line() when presented anything other than the sole "GET" method permitted by spec. Revert to the correct APLOGNO ID for this case Submitted by: wrowe Backport: r1757921, r1757924 Folding StrictWhitespace into the Strict ruleset of RFC7230, per dev@ poll. This choice is unanimous, although StrictURI (a different RFC) still hasn't found absolute concensus. Submitted by: wrowe Backport: r1758226 Correct the parser construction for several optimizations, based on the fact that bad whitespace shall not be permitted or corrected in any operating mode, while preserving the ability to extract bad method/uri/proto for later reporting and diagnostics. This change causes badwhitespace in the request line or any request field line to always fail, and not honor the setting of the HttpProtocolOptions Unsafe option. Mult SP characters or trailing SP characters in the request line are still permitted in Unsafe mode. Adjusted several error message emits to match these changes. Submitted by: wrowe Backport: r1758263 Clarify documentation based on concensus decisions discussed on dev@ and reflecting the current implementation, clean up stray <p> Submitted by: wrowe Backport: r1758265, r1758266 New optional flag to enforce <CR><LF> line delimiters in ap_[r]getline, created by overloading 'int fold' (1 or 0) as 'int flags', with the same value 1 for AP_GETLINE_FOLD (which httpd doesn't use), and a new value 2 for AP_GETLINE_CRLF Enforce CRLF when HttpProtocolOptions Strict is in force. Correctly introduces a new t/TEST fail. Submitted by: wrowe Backport: r1758304 Calm some overly agressive crlf handling, and clarify Submitted by: wrowe Backport: r1758305, r1758313 Review of IE 11, Firefox 48 and Chrome 53 all indicate that ';' URI characters are transmitted unencoded, per RFC3986 section 3.3 grammer. Correct httpd's behavior to not encode ';' in proxied URI's or Location: response headers. Submitted by: wrowe Backport: r1760444 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x-merge-http-strict@1769669 13f79535-47bb-0310-9956-ffa450edef68
parent
62f8456e
Please register or sign in to comment