httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Will Lowe <ha...@thebackrow.net>
Subject Re: 1.x: byte-range with ErrorDocuments returns incorrect status code
Date Thu, 04 Mar 2004 19:43:57 GMT
Thanks for the quick response -- sorry I've been slow getting back to
you. Yes, the attached patch does seem to fix 1.3.X.  It'd be great if
it got rolled into the next point release.

On Thu, Feb 26, 2004 at 09:18:02AM -0500, Geoffrey Young wrote:
> 
> 
> Will Lowe wrote:
> > It looks like byte-range requests on non-existant files returns 206
> > instead of 404 if ErrorDocument is set.  
> 
> I was able to verify this - it looks like there's some simple logic in 2.0
> that wasn't carried over to 1.3.
> 
> so, try this patch.  all the byterange tests in the perl-framework pass with
> it, in addition to my own ErrorDocument tests that I used to reproduce the
> problem.
> 
> if anyone on 1.3 support is paying attention, what's the proper course for
> insertion into the stable tree once things are verified - add to STATUS and
> wait for reviews/votes?
> 
> --Geoff

> Index: src/main/http_protocol.c
> ===================================================================
> RCS file: /home/cvspublic/apache-1.3/src/main/http_protocol.c,v
> retrieving revision 1.332
> diff -u -r1.332 http_protocol.c
> --- src/main/http_protocol.c	16 Feb 2004 22:29:33 -0000	1.332
> +++ src/main/http_protocol.c	26 Feb 2004 14:14:21 -0000
> @@ -260,7 +260,7 @@
>      if (!(range = ap_table_get(r->headers_in, "Range")))
>          range = ap_table_get(r->headers_in, "Request-Range");
>  
> -    if (!range || strncasecmp(range, "bytes=", 6)) {
> +    if (!range || strncasecmp(range, "bytes=", 6) || r->status != HTTP_OK) {
>          return 0;
>      }
>      range += 6;


-- 
					thanks,
		
					Will

Mime
View raw message