httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@kiwi.ICS.UCI.EDU>
Subject Re: [PATCH] error responses have wrong headers
Date Tue, 06 May 1997 23:51:06 GMT
>> That changed when I did the big header table patch.  The problem is that
>> the code cannot enforce HTTP compliance if their are two tables being
>> output instead of just one, so it merges the tables first.  We could
>> return to the old behavior simply by clearing the r->headers_out
>> table (using a new table_empty() function, please) before calling
>> send_http_header(r) in http_protocol.c:send_error_response().
>Bleh!  This is a mess.  If we do what you suggest, and also tweak mod_neg
>to move Alternates and Vary to err_headers_out, have we covered all the

I think so.  I'd like to do a pass through the code to see if headers
are really going to the right array, and most of the changes in your
patch are worthwhile even with this (more basic) change.

>Are these the semantics then?
>    headers_out	headers sent only with 200..299 responses
>    err_headers_out	headers sent with all responses

Yes.  Note that these semantics were only documented in httpd.h, so it
is unclear whether all the modules are doing the right thing.  I can work
up a patch tomorrow, but here are the basics

   a) restore the comment in httpd.h about the semantics

   b) in send_error_response, before calling send_http_header, add

        r->headers_out = r->err_headers_out;
        r->err_headers_out = NULL;

   c) in send_http_header, encapsulate the overlay_tables call with

        if (r->err_headers_out && r->err_headers_out->nelts) {
            r->headers_out = overlay_tables(...)

This is from memory (I'm at home right now and access is excruciatingly
slow today).

.....Roy [kicking himself for not doing this in the first place]

View raw message