httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kraemer <Martin.Krae...@mch.sni.de>
Subject Re: [BUG] 1.3.8 broke mod_speling
Date Thu, 12 Aug 1999 14:04:30 GMT
On Thu, Aug 12, 1999 at 02:45:52PM +0200, Martin Kraemer wrote:
>         if (ap_is_HTTP_REDIRECT(status) || (status == HTTP_CREATED)) {
> 	    if ((location != NULL) && *location) {
> 		ap_table_setn(r->headers_out, "Location", location);
> 	    }
> 	    else {
> 		/*
> 		 * We're supposed to tell the client to go somewhere,
> 		 * but the destination was omitted.  Turn this into
> 		 * a 500 status with an explanatory note in the error log.

Actually, when looking at the various (current) 3xx error codes,
    #define HTTP_MULTIPLE_CHOICES              300
    #define HTTP_MOVED_PERMANENTLY             301
    #define HTTP_MOVED_TEMPORARILY             302
    #define HTTP_SEE_OTHER                     303
    #define HTTP_NOT_MODIFIED                  304
    #define HTTP_USE_PROXY                     305
    #define HTTP_TEMPORARY_REDIRECT            307
I think it is best to replace the
>         if (ap_is_HTTP_REDIRECT(status) || (status == HTTP_CREATED)) {

test by either

	  if ((status == HTTP_CREATED) ||
	      (ap_is_HTTP_REDIRECT(status) &&
	       (status != HTTP_MULTIPLE_CHOICES &&
		status != HTTP_NOT_MODIFIED))) {

or (more precise check, avoids error for obsolete 306 code):

	  if (status == HTTP_MOVED_PERMANENTLY  ||
	      status == HTTP_MOVED_TEMPORARILY  ||
	      status == HTTP_TEMPORARY_REDIRECT ||
	      status == HTTP_SEE_OTHER          ||
	      status == HTTP_USE_PROXY          ||
	      status == HTTP_CREATED) {

because neither HTTP_NOT_MODIFIED nor HTTP_MULTIPLE_CHOICES
(or the obsolete 306 response) _require_ a Location: header.

    Martin
====
>From rfc2616, 10.3.1 300 Multiple Choices:
   If the server has a preferred choice of representation, it SHOULD
   include the specific URI for that representation in the Location
   field; user agents MAY use the Location field value for automatic
   redirection.

>From rfc2616, 10.3.5 304 Not Modified:
   The response MUST include the following header fields:
      - Date, unless its omission is required by section 14.18.1
      - ETag and/or Content-Location, if the header would have been sent
	in a 200 response to the same request
      - Expires, Cache-Control, and/or Vary, if the field-value might
	differ from that sent in any previous response for the same
	variant
   If the conditional GET used a strong cache validator (see section
   13.3.3), the response SHOULD NOT include other entity-headers.
   Otherwise (i.e., the conditional GET used a weak validator), the
   response MUST NOT include other entity-headers; this prevents
   inconsistencies between cached entity-bodies and updated headers.
>From rfc2616, 10.3.7 306 (Unused)
   The 306 status code was used in a previous version of the
   specification, is no longer used, and the code is reserved.
-- 
<Martin.Kraemer@MchP.Siemens.De>      |        Siemens Information and
Phone: +49-89-636-46021               |        Communication  Products
FAX:   +49-89-636-47816               |        81730  Munich,  Germany

Mime
View raw message