[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
Wed Mar 23 01:20:21 UTC 2011

#16888: WP HTTP Curl transport is only handling some but not all redirect status
 Reporter:  hakre        |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  HTTP         |     Version:  3.1
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
Changes (by dd32):

 * type:  defect (bug) => enhancement
 * milestone:  Awaiting Review => Future Release


 Replying to [comment:7 hakre]:
 > Done: [http://hakre.wordpress.com/2011/03/21/http-redirect-codes-3xx-
 and-the-location-field/ HTTP Redirect Codes (3xx) and the Location Field]

 Looks like you've inverted all your logic there. By your logic we
 shouldn't redirect in every case we currently do.

 Summarizing here for the purpose of keeping things in one place:
 10.3.1 300 Multiple Choices
    The requested resource corresponds to any one of a set of
    representations, each with its own specific location, and agent-
    driven negotiation information.
    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

 10.3.4 303 See Other
    The response to the request can be found under a different URI and
     SHOULD be retrieved using a GET method on that resource.

 10.3.6 305 Use Proxy
    The requested resource MUST be accessed through the proxy given by
    the Location field. The Location field gives the URI of the proxy.
    The recipient is expected to repeat this single request via the

 10.3.8 307 Temporary Redirect
    The requested resource resides temporarily under a different URI.
    The temporary URI SHOULD be given by the Location field in the
    If the 307 status code is received in response to a request other
    than GET or HEAD, the user agent MUST NOT automatically redirect the
    request unless it can be confirmed by the user, since this might
    change the conditions under which the request was issued.
 Selectively copied segments which is of use to this ticket, both 303 and
 307 specify that many HTTP 1.0 clients do not understand them, and a 302
 is recommended for interoperability. 300 can be treated like a 301/302 (As
 we do not do user-agent negotiation, if the servers preferred method is
 there, take it)

 I'm throwing this into Future Release as a enhancement, The WP_HTTP class
 currently supports the most common redirection methods in use on the web
 today (I'd challenge anyone to find anyone actively using them..)

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

More information about the wp-trac mailing list