httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <...@manyfish.co.uk>
Subject [PATCH] 1.3: fix 416 response
Date Sun, 26 Aug 2001 17:25:20 GMT
Hi,

The 416 "range not satisfiable" response currently includes a
Content-Length header set to the size of the resource, but no body is
actually returned (r->header_only is set to 1). This appears as a
premature EOF to the client.  The patch below fixes this.

Reproduce with /foo of size 172 bytes, and do

GET /foo HTTP/1.1
Host: www
Range: bytes=173-

Regards,

joe

--- http_protocol.c~	Fri Feb 16 14:53:24 2001
+++ http_protocol.c	Sun Aug 26 16:53:17 2001
@@ -356,6 +356,7 @@
 	else {
 	    ap_table_setn(r->headers_out, "Content-Range",
 		ap_psprintf(r->pool, "bytes */%ld", r->clength));
+	    ap_set_content_length(r, 0);			  
 	    r->boundary = NULL;
 	    r->range = range;
 	    r->header_only = 1;






Mime
View raw message