[wp-trac] [WordPress Trac] #16888: WP HTTP Curl transport is only handling some but not all redirect status codes.

WordPress Trac wp-trac at lists.automattic.com
Mon Mar 21 09:05:19 UTC 2011

#16888: WP HTTP Curl transport is only handling some but not all redirect status
 Reporter:  hakre         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  HTTP          |     Version:  3.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |

Comment (by hakre):

 Replying to [comment:3 sivel]:
 > Not all 3xx codes indicate a redirection.  For example 304 is a not
 modified and has nothing to do with redirection.

 The RFC 2616 speaks another language (6.1.1 Status Code and Reason

     The first digit of the Status-Code defines the class of response.
       - 3xx: Redirection - Further action must be taken in order to
         complete the request

 And further on in specific of the 304 status
 ([http://tools.ietf.org/html/rfc2616#section-10.3.5 which is specified]):

    If the client has performed a conditional GET request and access is
    allowed, but the document has not been modified, the server SHOULD
    respond with this status code. The 304 response MUST NOT contain a
    message-body, and thus is always terminated by the first empty line
    after the header fields.

 > Returning a WP_Error on a 304 would be incorrect behavior, as someone
 may be expecting to get additional information when a 304 is received.

 If redirects are limited and the request results in a going-over-that-
 limit, then I would expect the function to return an error. Per all
 specification documents related to the context of HTTP the classification
 of the 3xx codes as being all redirects per RFC make me think so.

 If you can provide any document with some authority on the subject
 specifying the 304 status not being classified as redirect, please link
 it, I would be interested.

 If you're setting the redirection parameter to control a follow-location-
 header behavior, an additional parameter might be more flexible to
 actually control something (and prevent error return values): #16889.

Ticket URL: <http://core.trac.wordpress.org/ticket/16888#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list