On Sun, Dec 29, 2013 at 3:48 PM, Jim Jagielski <[email protected]> wrote:
> Yeah, I'm leaning towards agreeing w/ you there.
Both directives (HttpContentLengthHeadZero and HttpExpectStrict)
committed in r1554303. See below for how it affects the wire
protocol.
Now, let's discuss the defaults. =) I'm +1 to the below patch. -- justin
Index: modules/http/http_filters.c
===================================================================
--- modules/http/http_filters.c (revision 1554304)
+++ modules/http/http_filters.c (working copy)
@@ -1254,7 +1254,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_heade
if (r->header_only
&& (clheader = apr_table_get(r->headers_out, "Content-Length"))
&& !strcmp(clheader, "0")
- && conf->http_cl_head_zero != AP_HTTP_CL_HEAD_ZERO_ENABLE) {
+ && conf->http_cl_head_zero == AP_HTTP_CL_HEAD_ZERO_DISABLE) {
apr_table_unset(r->headers_out, "Content-Length");
}
-----------
% touch foo.txt
No HttpContentLengthHeadZero directive
% curl -I http://127.0.0.1:8080/foo.txt
HTTP/1.1 200 OK
Date: Mon, 30 Dec 2013 19:26:49 GMT
Server: Apache/2.5.0-dev (Unix) mod_fcgid/2.3.10-dev
Last-Modified: Mon, 30 Dec 2013 19:24:39 GMT
ETag: "0-4eec56519cbc0"
Accept-Ranges: bytes
Content-Type: text/plain
HttpContentLengthHeadZero on
% curl -I http://127.0.0.1:8080/foo.txt
HTTP/1.1 200 OK
Date: Mon, 30 Dec 2013 19:26:10 GMT
Server: Apache/2.5.0-dev (Unix) mod_fcgid/2.3.10-dev
Last-Modified: Mon, 30 Dec 2013 19:24:39 GMT
ETag: "0-4eec56519cbc0"
Accept-Ranges: bytes
Content-Length: 0
Content-Type: text/plain
HttpContentLengthHeadZero off
% curl -I http://127.0.0.1:8080/foo.txt
HTTP/1.1 200 OK
Date: Mon, 30 Dec 2013 19:27:05 GMT
Server: Apache/2.5.0-dev (Unix) mod_fcgid/2.3.10-dev
Last-Modified: Mon, 30 Dec 2013 19:24:39 GMT
ETag: "0-4eec56519cbc0"
Accept-Ranges: bytes
Content-Type: text/plain
---
% curl -H "Expect: 100-continue" -I http://127.0.0.1:8080/foo.txt
HTTP/1.1 200 OK
Date: Mon, 30 Dec 2013 19:46:36 GMT
Server: Apache/2.5.0-dev (Unix) mod_fcgid/2.3.10-dev
Last-Modified: Mon, 30 Dec 2013 19:24:39 GMT
ETag: "0-4eec56519cbc0"
Accept-Ranges: bytes
Content-Length: 0
Connection: close
Content-Type: text/plain
No HttpExpectStrict directive
% curl -H "Expect: 100-contine" -I http://127.0.0.1:8080/foo.txt
HTTP/1.1 417 Expectation Failed
Date: Mon, 30 Dec 2013 19:48:19 GMT
Server: Apache/2.5.0-dev (Unix) mod_fcgid/2.3.10-dev
Content-Length: 0
Content-Type: text/html; charset=iso-8859-1
HttpExpectStrict on
% curl -H "Expect: 100-contine" -I http://127.0.0.1:8080/foo.txt
HTTP/1.1 417 Expectation Failed
Date: Mon, 30 Dec 2013 19:46:46 GMT
Server: Apache/2.5.0-dev (Unix) mod_fcgid/2.3.10-dev
Content-Length: 0
Content-Type: text/html; charset=iso-8859-1
HttpExpectStrict off
% curl -H "Expect: 100-contine" -I http://127.0.0.1:8080/foo.txt
HTTP/1.1 200 OK
Date: Mon, 30 Dec 2013 19:47:53 GMT
Server: Apache/2.5.0-dev (Unix) mod_fcgid/2.3.10-dev
Last-Modified: Mon, 30 Dec 2013 19:24:39 GMT
ETag: "0-4eec56519cbc0"
Accept-Ranges: bytes
Content-Length: 0
Content-Type: text/plain