1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00
Commit Graph

1260 Commits

Author SHA1 Message Date
Eric Covener
f05f006b85 PR60647: ACC per connection not available w/ event MPM
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1780280 13f79535-47bb-0310-9956-ffa450edef68
2017-01-25 22:23:43 +00:00
Yann Ylavic
c34870e09e http: follow up to r1777460.
We MUST unfold outgoing HTTP headers in any case, "message/http" is for
inner content.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1777672 13f79535-47bb-0310-9956-ffa450edef68
2017-01-06 18:04:31 +00:00
Christophe Jaillet
4ceaede796 Remove definition of ASCII_CRLF which is the same as CRLF_ASCII.
Remove definition of ASCII_ZERO which is the same as ZERO_ASCII.

Use ZERO_ASCII and CRLF_ASCII in chunk_filter

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1777622 13f79535-47bb-0310-9956-ffa450edef68
2017-01-06 14:57:33 +00:00
Yann Ylavic
157d20dcea http: allow folding in check_headers(), still compliant with RFC 7230 (3.2.4).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1777460 13f79535-47bb-0310-9956-ffa450edef68
2017-01-05 12:31:48 +00:00
Yann Ylavic
549d1d7627 http_header_filter: on check_headers() failure, use AP_FILTER_ERROR and EOC
semantics to respectively warn the caller and cleanly terminate the connection
afterwards.

Suggested by: rpluem



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1775195 13f79535-47bb-0310-9956-ffa450edef68
2016-12-20 00:58:52 +00:00
Yann Ylavic
60586e25cf http: release data buckets (memory, fd, ...) as soon as possible when
filtered out from the outgoing brigade by ap_http_outerror_filter() applying
the EOC semantic.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1774322 13f79535-47bb-0310-9956-ffa450edef68
2016-12-14 19:16:59 +00:00
Yann Ylavic
2be4a91b59 Follow up to r1773761: restore EOC semantic.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1774286 13f79535-47bb-0310-9956-ffa450edef68
2016-12-14 16:19:05 +00:00
Yann Ylavic
366a562546 Follow up to r1773761: improved recursion detection.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773865 13f79535-47bb-0310-9956-ffa450edef68
2016-12-12 20:31:44 +00:00
Yann Ylavic
749c178790 Follow up to r1773761: we need to check both ap_send_error_response() and internal redirect recursions.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773862 13f79535-47bb-0310-9956-ffa450edef68
2016-12-12 19:44:20 +00:00
Yann Ylavic
ce9505bf0b Follow up to r1773761: don't recurse on ap_send_error_response() either.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773861 13f79535-47bb-0310-9956-ffa450edef68
2016-12-12 19:39:17 +00:00
Yann Ylavic
56ffeebf66 Follow up to r1773761: don't recurse on internal redirects.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773812 13f79535-47bb-0310-9956-ffa450edef68
2016-12-12 16:14:50 +00:00
Yann Ylavic
64350668a2 Follow up to r1773761: don't check_headers() more than once.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773779 13f79535-47bb-0310-9956-ffa450edef68
2016-12-12 12:06:06 +00:00
Yann Ylavic
552b23d21e Follow up to r1773293.
When check_headers() fails, clear anything (headers and body) from original/errorneous
response before returning 500.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773761 13f79535-47bb-0310-9956-ffa450edef68
2016-12-12 10:26:16 +00:00
Luca Toscano
ffabf5f53e Drop C-L header and message-body from HTTP 204 responses.
The C-L header can be set in a fcgi/cgi backend or in other
filters like ap_content_length_filter (with the value of 0),
meanwhile the message-body can be returned incorrectly
by any backend. The idea is to remove unnecessary bytes
from a HTTP 204 response.

PR 51350


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773346 13f79535-47bb-0310-9956-ffa450edef68
2016-12-09 09:29:57 +00:00
Eric Covener
74b59485b8 change error handling for bad resp headers
- avoid looping between ap_die and the http filter
 - remove the header that failed the check
 - keep calling apr_table_do until our fn stops matching


This is still not great. We get the original body, a 500 status
code and status line.

(r1773285 + fix for first return from check_headers)




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773293 13f79535-47bb-0310-9956-ffa450edef68
2016-12-08 19:57:57 +00:00
Eric Covener
8763c1b88e revert r1773285
breaks some existing tests. Needs more work.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773292 13f79535-47bb-0310-9956-ffa450edef68
2016-12-08 19:54:49 +00:00
Eric Covener
8f418b2e62 change error handling for bad resp headers
- avoid looping between ap_die and the http filter
 - remove the header that failed the check
 - keep calling apr_table_do until our fn stops matching


This is still not great. We get the original body, a 500 status
code and status line.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773285 13f79535-47bb-0310-9956-ffa450edef68
2016-12-08 19:34:54 +00:00
William A. Rowe Jr
0d2dda0d35 After eliminating unusual whitespace in Unsafe mode (e.g. \f \v), we are left
with the same behavior in both of these cases. Simplify. Noted by rpluem.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773162 13f79535-47bb-0310-9956-ffa450edef68
2016-12-07 23:38:47 +00:00
Eric Covener
1597a10583 loop in checking response headers
w/ HTTPProtocolOptions Unsafe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1772418 13f79535-47bb-0310-9956-ffa450edef68
2016-12-03 00:10:31 +00:00
Ruediger Pluem
9858526f1f * Fix numbers count in comment.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1771690 13f79535-47bb-0310-9956-ffa450edef68
2016-11-28 09:04:26 +00:00
Stefan Eissing
afee26bc50 Removing unused warning after r1764961 changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1770817 13f79535-47bb-0310-9956-ffa450edef68
2016-11-22 09:51:37 +00:00
Eric Covener
c7c184645f remove Location: header checks for absolute URL
https://tools.ietf.org/html/rfc7231#section-7.1.2

   The "Location" header field is used in some responses to refer to a
   specific resource in relation to the response.  The type of
   relationship is defined by the combination of request method and
   status code semantics.

     Location = URI-reference

   The field value consists of a single URI-reference.  When it has the
   form of a relative reference ([RFC3986], Section 4.2), the final
   value is computed by resolving it against the effective request URI
   ([RFC3986], Section 5).


There is even an example with no scheme:

     Location: /People.html#tim



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1770786 13f79535-47bb-0310-9956-ffa450edef68
2016-11-22 01:53:40 +00:00
Stefan Eissing
2ebdeabd30 addendum to r1769760 to make it generate 100 status lines
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1770220 13f79535-47bb-0310-9956-ffa450edef68
2016-11-17 15:43:54 +00:00
Yann Ylavic
ef6e478b78 http: Allow unknown response status' lines returned in the form of:
HTTP/x.x xxx Status xxx



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1769760 13f79535-47bb-0310-9956-ffa450edef68
2016-11-15 09:06:55 +00:00
Jacob Champion
091f96ee10 Remove unnecessary apr_table_do() function casts
Function casts can cause hard-to-debug corruption issues if a
declaration is accidentally changed to be incompatible. Luckily, most of
the function casts for apr_table_do() calls are unnecessary. Remove
them, and adjust the signatures for helpers that weren't taking void* as
the first argument.

The remaining helper that requires a cast is http_filter.c's
form_header_field(), which is probably where many of these casts were
copy-pasted from. I have left it as-is: it has other direct callers
besides apr_table_do(), and it's already documented with warnings not to
change the function signature.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1769192 13f79535-47bb-0310-9956-ffa450edef68
2016-11-10 20:53:21 +00:00
William A. Rowe Jr
5b2748e303 Appears we cannot disallow this whitespace, since the chunk BNF coexisted
with the implied *LWS rule, before RFC7230 eliminated the later. Whether
this is actually OWS or BWS is an editorial decision beyond our pay grade.




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1765475 13f79535-47bb-0310-9956-ffa450edef68
2016-10-18 16:30:43 +00:00
Yann Ylavic
81cdebf482 ap_check_pipeline: clarify/simplify !max_blank_lines logic, no functional change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1765061 13f79535-47bb-0310-9956-ffa450edef68
2016-10-15 13:31:31 +00:00
William A. Rowe Jr
84ce5d25db Dropped the never-released ap_has_cntrls() as it had very limited
and inefficient application at that, added ap_scan_vchar_obstext()
to accomplish a similar purpose.

Dropped HttpProtocolOptions StrictURL option, this will be better
handled in the future with a specific directive and perhaps multiple
levels of scrutiny, use ap_scan_vchar_obstext() to simply ensure there
are no control characters or whitespace within the URI.

Changed the scanning of the response header table by check_headers()
to follow the same rulesets as reading request headers. Disallow any
CTL character within a response header value, and any CTL or whitespace
in response header field name, even in strict mode.

Apply HttpProtocolOptions Strict to chunk header parsing, invalid
whitespace is invalid, line termination must follow CRLF convention.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1764961 13f79535-47bb-0310-9956-ffa450edef68
2016-10-14 20:48:43 +00:00
William A. Rowe Jr
fc367d65ee Rename the previously undocumented HTTPProtocol directive
to EnforceHTTPProtocol, and invert the default behavior
to strictly observe RFC 7230 unless otherwise configured.
And Document This.

The relaxation option is renamed 'Unsafe'. 'Strict' is no
longer case sensitive. 'min=0.9|1.0' is now the verbose
'Allow0.9' or 'Require1.0' case-insenstive grammer. The
exclusivity tests have been modified to detect conflicts.

The 'strict,log' option failed to enforce strict conformance,
and has been removed. Unsafe, informational logging is possible
in any loadable module, after the request data is unsafely
accepted.

This triggers a group of failures in t/apache/headers.t as
expected since those patterns violated RFC 7230 section 3.2.4.




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756540 13f79535-47bb-0310-9956-ffa450edef68
2016-08-16 18:11:14 +00:00
Yann Ylavic
1bda0469cf [mod_proxy_]http: follow up to r1750392.
Export [ap_]check_pipeline() and use it also for ap_proxy_check_connection(),
so that all the necessary checks on the connection are done before reusing it.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756186 13f79535-47bb-0310-9956-ffa450edef68
2016-08-12 13:58:10 +00:00
Yann Ylavic
104ef73c95 Revert r1756064 and r1756060 until fixed (tests framework passes).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756065 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 23:37:45 +00:00
Yann Ylavic
25b8c2b589 http: follow up to r1750392.
Restore AP_MODE_READBYTES cleared inadvertently in r1756060.

[Reverted by r1756065]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756064 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 23:24:47 +00:00
Yann Ylavic
2023d56eea [mod_proxy_]http: follow up to r1750392.
Export [ap_]check_pipeline() and use it also for ap_proxy_check_connection().

[Reverted by r1756065]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756060 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 22:32:42 +00:00
Rainer Jung
d79b514c4b Fix spelling in comments and text files.
No functional change.
PR 59990


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756038 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 19:50:02 +00:00
William A. Rowe Jr
ea506b6708 A whole lotta nope, if you implement HTCPCP then register your methods in init
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1753263 13f79535-47bb-0310-9956-ffa450edef68
2016-07-18 16:20:27 +00:00
William A. Rowe Jr
26e6eaab3e Restore 'HEAD' method as a special case of GET with the common ID
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1753257 13f79535-47bb-0310-9956-ffa450edef68
2016-07-18 16:01:21 +00:00
William A. Rowe Jr
4a87665e53 The method_registry is initialized in register_hooks() for mod_http
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1753245 13f79535-47bb-0310-9956-ffa450edef68
2016-07-18 15:31:39 +00:00
William A. Rowe Jr
448c82bfd5 Simplify; this code is executed one per request processed, saving
an immeasurably small quantum of CPU of a server under load.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1753223 13f79535-47bb-0310-9956-ffa450edef68
2016-07-18 13:41:26 +00:00
William A. Rowe Jr
f4cc76ee71 Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygen
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747469 13f79535-47bb-0310-9956-ffa450edef68
2016-06-09 00:06:42 +00:00
William A. Rowe Jr
00e295490d Avoid truncating the_request line when there is no request to 'W'rite.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1743699 13f79535-47bb-0310-9956-ffa450edef68
2016-05-13 16:52:33 +00:00
William A. Rowe Jr
c9516818c9 Revert 1742822, incorrect assumptions here
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1743511 13f79535-47bb-0310-9956-ffa450edef68
2016-05-12 14:50:09 +00:00
Rainer Jung
7af0761959 Fix yet another case where we clobber the
server-status request info when a timeout happens.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1742822 13f79535-47bb-0310-9956-ffa450edef68
2016-05-08 13:53:37 +00:00
Yann Ylavic
8c52bb1c1a http: Respond with "408 Request Timeout" when a timeout occurs while
reading the request body.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1739201 13f79535-47bb-0310-9956-ffa450edef68
2016-04-14 21:41:13 +00:00
Yann Ylavic
239ac0c076 Follow up to r1734656: restore c->data_in_input_filters usage to
see if it helps unblocking test framework.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1736216 13f79535-47bb-0310-9956-ffa450edef68
2016-03-22 17:08:29 +00:00
Stefan Eissing
c4cf57c511 reverting r1735176
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735226 13f79535-47bb-0310-9956-ffa450edef68
2016-03-16 13:00:37 +00:00
Graham Leggett
20ede5ebda mod_http: Make sure HTTP filters are added on HTTP requests only.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735176 13f79535-47bb-0310-9956-ffa450edef68
2016-03-15 23:13:43 +00:00
Graham Leggett
64eaf888e9 core: Extend support for setting aside data from the network input filter
to any connection or request input filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1734656 13f79535-47bb-0310-9956-ffa450edef68
2016-03-12 00:43:58 +00:00
Jim Jagielski
256e5cbdad Add 451... Needed to adjust RESPONSE_CODES which
was not in the provided patch
BUGZ# 58985

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730723 13f79535-47bb-0310-9956-ffa450edef68
2016-02-16 17:33:31 +00:00
Eric Covener
367c71d3cc revert r1725348, force-response-1.0 is not suggested.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725857 13f79535-47bb-0310-9956-ffa450edef68
2016-01-21 02:24:51 +00:00
Eric Covener
1ea8890010 leave a note that RFC7230 suggests force-response-1.0 behavior.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725348 13f79535-47bb-0310-9956-ffa450edef68
2016-01-18 21:11:46 +00:00