1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-13 21:42:17 +03:00
Commit Graph

1168 Commits

Author SHA1 Message Date
Justin Erenkrantz
93143eb07b Add directives to control two protocol options:
HttpContentLengthHeadZero - allow Content-Length of 0 to be returned on HEAD
 HttpExpectStrict - allow admin to control whether we must see "100-continue"

This is helpful when using Ceph's radosgw and httpd.

Inspired by: Yehuda Sadeh <yehuda@inktank.com>
See https://github.com/ceph/apache2/commits/precise

* include/http_core.h
  (core_server_config): Add http_cl_head_zero and http_expect_strict fields.
* modules/http/http_filters.c
  (ap_http_header_filter): Only clear out the C-L if http_cl_head_zero is not
  explictly set.
* server/core.c
  (merge_core_server_configs): Add new fields.
  (set_cl_head_zero, set_expect_strict): New config helpers.
  (HttpContentLengthHeadZero, HttpExpectStrict): Declare new directives.
* server/protocol.c
  (ap_read_request): Allow http_expect_strict to control if we return 417.
* include/ap_mmn.h
  (MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR): Bump.
* CHANGES: Add a brief description.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1554303 13f79535-47bb-0310-9956-ffa450edef68
2013-12-30 20:01:14 +00:00
William A. Rowe Jr
6c8aff78f1 Use a distinguishing APLOGNO for unk t-e with read-until-close behavior
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1541368 13f79535-47bb-0310-9956-ffa450edef68
2013-11-13 02:55:06 +00:00
Jim Jagielski
a194875231 80 rule
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1541290 13f79535-47bb-0310-9956-ffa450edef68
2013-11-12 22:48:33 +00:00
William A. Rowe Jr
9a8af6d236 Wrap at 80 still, here at httpd project
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1541270 13f79535-47bb-0310-9956-ffa450edef68
2013-11-12 22:14:54 +00:00
Jim Jagielski
a95d847f66 PR 55475: Detect incomplete body in HTTP input filter and return APR_INCOMPLETE
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1538776 13f79535-47bb-0310-9956-ffa450edef68
2013-11-04 21:31:27 +00:00
Chris Darroch
151a95ae46 Correct typo in comments for ap_map_http_request_error().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1529991 13f79535-47bb-0310-9956-ffa450edef68
2013-10-07 16:14:39 +00:00
Rainer Jung
6a76621f9f core: Add missing Reason-Phrase in HTTP response headers.
PR 54946.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1529014 13f79535-47bb-0310-9956-ffa450edef68
2013-10-03 21:50:07 +00:00
Jim Jagielski
5e6a9dee07 draft-ietf-httpbis-p1-messaging-23 fixes regarding interactions
between TE and content-length in the same req/resp.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1524770 13f79535-47bb-0310-9956-ffa450edef68
2013-09-19 15:30:10 +00:00
Jim Jagielski
b18fa49a75 revert 1524161 for the time being
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1524190 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 19:37:03 +00:00
Jim Jagielski
a10a8937ac RFC2616 issue
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1524161 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 18:37:18 +00:00
Graham Leggett
0632971eac Update the log message number.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1494549 13f79535-47bb-0310-9956-ffa450edef68
2013-06-19 11:19:50 +00:00
Graham Leggett
98552db215 Ensure that any meta buckets are stripped while parsing a chunk.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1485772 13f79535-47bb-0310-9956-ffa450edef68
2013-05-23 16:31:01 +00:00
Graham Leggett
be4fefc51e core: Use a matching counter type.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1485266 13f79535-47bb-0310-9956-ffa450edef68
2013-05-22 16:11:23 +00:00
Graham Leggett
2a729432cd core: Make sure we allow unconstrained bodies from a proxy.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1485257 13f79535-47bb-0310-9956-ffa450edef68
2013-05-22 15:49:57 +00:00
Graham Leggett
d0dccd8815 core: Remove apr_brigade_flatten(), buffering and duplicated code
from the HTTP_IN filter, parse chunks in a single pass with zero copy.
Reduce memory usage by 48 bytes per request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1484852 13f79535-47bb-0310-9956-ffa450edef68
2013-05-21 16:10:02 +00:00
Graham Leggett
324994c36a core: Stop ap_finalize_request_protocol() and ap_get_client_block() from silently
swallowing errors from the filter stack, create error buckets and return them
appropriately.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1482918 13f79535-47bb-0310-9956-ffa450edef68
2013-05-15 15:46:01 +00:00
Graham Leggett
9bc9d79079 core: Stop the HTTP_IN filter from attempting to write error buckets
to the output filters, which is bogus in the proxy case. Create a
clean mapping from APR codes to HTTP status codes, and use it where
needed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1482522 13f79535-47bb-0310-9956-ffa450edef68
2013-05-14 18:58:06 +00:00
Graham Leggett
61f014bf78 Fix spelling mistake, no code change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1480046 13f79535-47bb-0310-9956-ffa450edef68
2013-05-07 19:36:33 +00:00
Graham Leggett
6194962c46 core, mod_cache: Ensure RFC2616 compliance in ap_meets_conditions()
with weak validation combined with If-Range and Range headers. Break
out explicit conditional header checks to be useable elsewhere in the
server. Ensure weak validation RFC compliance in the byteranges filter.
Ensure RFC validation compliance when serving cached entities. PR 16142


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479905 13f79535-47bb-0310-9956-ffa450edef68
2013-05-07 13:42:31 +00:00
Graham Leggett
997e0f6d33 core: Add the ability to do explicit matching on weak and strong ETags
as per RFC2616 Section 13.3.3.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479528 13f79535-47bb-0310-9956-ffa450edef68
2013-05-06 11:41:10 +00:00
Guenter Knauf
2eb1a07d4a Stupid CodeWarrior compiler cant take vars with struct inits.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1428145 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 02:25:23 +00:00
Stefan Fritsch
d47f71f7d9 Remove support for Request-Range header sent by Navigator 2-3 and
MSIE 3


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1427465 13f79535-47bb-0310-9956-ffa450edef68
2013-01-01 17:00:23 +00:00
Stefan Fritsch
8283707a4f add log tags missing in r1426877
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1426879 13f79535-47bb-0310-9956-ffa450edef68
2012-12-30 01:28:17 +00:00
Stefan Fritsch
f726113d33 Add an option to enforce stricter HTTP conformance
This is a first stab, the checks will likely have to be revised.
For now, we check

 * if the request line contains control characters
 * if the request uri has fragment or username/password
 * that the request method is standard or registered with RegisterHttpMethod
 * that the request protocol is of the form HTTP/[1-9]+.[0-9]+,
   or missing for 0.9
 * if there is garbage in the request line after the protocol
 * if any request header contains control characters
 * if any request header has an empty name
 * for the host name in the URL or Host header:
   - if an IPv4 dotted decimal address: Reject octal or hex values, require
     exactly four parts
   - if a DNS host name: Reject non-alphanumeric characters besides '.' and
     '-'. As a side effect, this rejects multiple Host headers.
 * if any response header contains control characters
 * if any response header has an empty name
 * that the Location response header (if present) has a valid scheme and is
   absolute

If we have a host name both from the URL and the Host header, we replace the
Host header with the value from the URL to enforce RFC conformance.

There is a log-only mode, but the loglevels of the logged messages need some
thought/work. Currently, the  checks for incoming data log for 'core' and the
checks for outgoing data log for 'http'. Maybe we need a way to configure the
loglevels separately from the core/http loglevels.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1426877 13f79535-47bb-0310-9956-ffa450edef68
2012-12-30 01:23:24 +00:00
Christophe Jaillet
af32fbebef Avoid unnecessary %s substitution
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1419755 13f79535-47bb-0310-9956-ffa450edef68
2012-12-10 20:53:24 +00:00
Eric Covener
7eb8fbe0ba also copy r->invoke_mtx when creating a subrequest
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1402924 13f79535-47bb-0310-9956-ffa450edef68
2012-10-28 02:37:41 +00:00
Stefan Fritsch
8ec0c56b02 Code clean up (remove useless memory allocation)
Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr>
PR: 52648


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1361803 13f79535-47bb-0310-9956-ffa450edef68
2012-07-15 21:19:54 +00:00
Stefan Fritsch
8c960a8c15 Various code clean up
Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr>
PR: 52893 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1361801 13f79535-47bb-0310-9956-ffa450edef68
2012-07-15 21:14:00 +00:00
Rainer Jung
bfbbc819d5 Add missing HTTP status codes taken from
http://www.iana.org/assignments/http-status-codes/http-status-codes.xml 

The new codes are now known and some canned error
strings are provided. The web server does not yet actually
produce them in responses or reacts on getting them
from an origin server when acting as a proxy or gateway.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1361784 13f79535-47bb-0310-9956-ffa450edef68
2012-07-15 20:22:03 +00:00
Graham Leggett
e666d3a64e mod_mime: Don't arbitrarily bypass AddOutputFilter during a ProxyPass,
but then allow AddOutputFilter during a RewriteRule [P]. Make mod_mime
behave identically in both cases. PR52342.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1222370 13f79535-47bb-0310-9956-ffa450edef68
2011-12-22 17:48:17 +00:00
Stefan Fritsch
76f782e188 Various code cleanup to avoid compiler, cppcheck, or clang warnings:
modules/debugging/mod_firehose.c: Make some internal functions static
                                  (to do: logs_cleanup() is unused)

modules/filters/mod_charset_lite.c: Remove dead assignments

modules/filters/mod_include.c: likewise

modules/metadata/mod_usertrack.c: likewise

modules/proxy/mod_proxy_ftp.c: likewise

modules/ssl/ssl_engine_pphrase.c: likewise

modules/proxy/mod_proxy_balancer.c: likewise;
                                    Remove NULL check that can never happen

modules/proxy/proxy_util.c: Axe NULL-check that can never happen and if it
                            would, it would just mask another bug

os/unix/unixd.c: likewise

modules/http/http_filters.c: Remove sub-condition that is always true

modules/lua/mod_lua.c: Add default cases to switch statements

modules/generators/mod_autoindex.c: Unsigned value can never be < 0

server/util_expr_eval.c: Fix compiler warnings with VC and on OS2



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1220493 13f79535-47bb-0310-9956-ffa450edef68
2011-12-18 17:52:59 +00:00
Graham Leggett
2af2fa44ad Further clarify the naming of the entity that originates the request by
calling that entity a useragent instead of a client.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1214003 13f79535-47bb-0310-9956-ffa450edef68
2011-12-14 00:31:51 +00:00
Stefan Fritsch
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
Graham Leggett
394e5594d6 Introduce a per connection "peer_ip" and a per request "client_ip" to
distinguish between the raw IP address of the connection and the effective
IP address of the request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1206291 13f79535-47bb-0310-9956-ffa450edef68
2011-11-25 19:42:04 +00:00
Graham Leggett
4ee7eea4cf Introduce a per request version of the remote IP address, which can be
optionally modified by a module when the effective IP of the client
is not the same as the real IP of the client (such as a load balancer).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204968 13f79535-47bb-0310-9956-ffa450edef68
2011-11-22 13:10:39 +00:00
Stefan Fritsch
2bffeda10b Downgrade some more error messages about broken client behavior to level
info.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204630 13f79535-47bb-0310-9956-ffa450edef68
2011-11-21 18:16:01 +00:00
Stefan Fritsch
ab7b448082 Fix segfault caused by r1204104 on non-async mpms.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204180 13f79535-47bb-0310-9956-ffa450edef68
2011-11-20 16:41:42 +00:00
Stefan Fritsch
40ac38ff05 Remove MPM-private stuff from conn_state_t
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204104 13f79535-47bb-0310-9956-ffa450edef68
2011-11-19 23:35:46 +00:00
Stefan Fritsch
4db71797ea Fix 3xx responses with local URLs as ErrorDocument
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1187985 13f79535-47bb-0310-9956-ffa450edef68
2011-10-23 22:07:50 +00:00
Stefan Fritsch
a524f440c3 Adjust log message to reflect changed behaviour
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1175992 13f79535-47bb-0310-9956-ffa450edef68
2011-09-26 18:50:28 +00:00
Jim Jagielski
a7433ead1d Put 0- on the fast-track
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1175980 13f79535-47bb-0310-9956-ffa450edef68
2011-09-26 18:12:41 +00:00
Stefan Fritsch
1951a037bf More cleanup: Expand tabs and some more indentation fixes
No functional change


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174929 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 18:08:42 +00:00
Jim Jagielski
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
Stefan Fritsch
b279698681 use random value as multipart range boundary to prevent leaking information
about the used MPM


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1171250 13f79535-47bb-0310-9956-ffa450edef68
2011-09-15 19:55:27 +00:00
Stefan Fritsch
2d4e23d88b Create wrapper API for apr_random;
use in mod_lbmethod_heartbeat and mod_serf to
- replace some needles use of apr_generate_random_bytes
- remove code duplication


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1171247 13f79535-47bb-0310-9956-ffa450edef68
2011-09-15 19:53:59 +00:00
Jim Jagielski
625b89a7e2 Add in MaxRangeOverlaps and MaxRangeReversals to accomodate
more control over acceptable Range headers:

        See: http://trac.tools.ietf.org/wg/httpbis/trac/ticket/311

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1169756 13f79535-47bb-0310-9956-ffa450edef68
2011-09-12 14:15:53 +00:00
Jim Jagielski
0693a7054e Save creation of merged until we know we will actually need and use it.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1167310 13f79535-47bb-0310-9956-ffa450edef68
2011-09-09 17:44:37 +00:00
Jim Jagielski
c34f001809 return some range params admins may want to control (overlaps and reversals)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1167309 13f79535-47bb-0310-9956-ffa450edef68
2011-09-09 17:44:31 +00:00
Jim Jagielski
9cbc0b6774 Remove function so we can grab over core_conf elements easily
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1167308 13f79535-47bb-0310-9956-ffa450edef68
2011-09-09 17:44:29 +00:00
Jim Jagielski
2ab6b78667 Reorg so we don't need forward def...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1167307 13f79535-47bb-0310-9956-ffa450edef68
2011-09-09 17:44:26 +00:00