New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 6 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2011
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Restricted
  • Only users with EditIssue permission may comment.



Sign in to add a comment
link

Issue 56373: XHR rewrites non-POST methods upon 301/302 redirects

Reported by julian.r...@gmail.com, Sep 21 2010

Issue description

Chrome Version       : 7.0.517.8 (Offizieller Build 59474) dev
URLs (if applicable) : http://www.mnot.net/javascript/xmlhttprequest/
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
     Safari 4: FAIL
  Firefox 3.x: FAIL
         IE 7: OK
         IE 8: OK

What steps will reproduce the problem?
See test cases at http://www.mnot.net/javascript/xmlhttprequest/.

What is the expected result?
The test cases at http://www.mnot.net/javascript/xmlhttprequest/ show that XHR, when following a 301/302 redirect, changes the method to GET.

According to RFC 2616, Sections 10.3.2 and 10.3.3
(http://greenbytes.de/tech/webdav/rfc2616.html#rfc.section.10.3), this is a
bug.

That being said, it's understood that rewriting *POST* is required for
compatibility with existing content. However, this does not seem to be the case for other methods, as IE restricts the conformance violation to POST and apparently gets away with it.

Please consider tightening the implementation.


What happens instead?
Method is rewritten to GET.

Please provide any additional information below. Attach a screenshot if
possible.
 

Comment 1 by fraser@google.com, Sep 27 2010

This looks like a duplicate of  Issue 49684 .

Comment 2 by julian.r...@gmail.com, Sep 29 2010

It's certainly related. However,  Issue 49864  is specifically about HEAD; while this one is about every method except POST (thus, including things like PUT, OPTIONS, PROPFIND, or FOOBAR).

Comment 3 by wtc@chromium.org, Feb 1 2011

Labels: -Area-Undefined Area-Internals Internals-Network Area-WebKit

Comment 4 by karen@chromium.org, Feb 15 2011

Labels: kmoved-021511 Mstone-X

Comment 5 by willchan@chromium.org, Oct 20 2011

Cc: -tonyg@chromium.org mmenke@chromium.org
Labels: -Internals-Network -Area-WebKit -kmoved-021511 -Mstone-X Internals-Network-HTTP Mstone-17
Status: Untriaged
Let's do it! Matt, do you think you have time to make this change? It should be a small one. Otherwise, I can do it.

Comment 6 by mmenke@chromium.org, Oct 21 2011

Owner: mmenke@chromium.org
Status: Assigned
Sure, I'll do it.

Comment 7 by wtc@chromium.org, Oct 21 2011

mmenke: thanks.  Please cc me in the code review.

Comment 8 by mmenke@chromium.org, Oct 21 2011

Will do.

Comment 9 by julian.r...@gmail.com, Oct 24 2011

Note that HTTPbis, Part 2, version 17, will change the requirement from "all methods" to "all methods except POST", so that browsers can continue to do what they do for HTML forms.

See http://trac.tools.ietf.org/wg/httpbis/trac/ticket/160

Comment 10 by bugdroid1@chromium.org, Oct 26 2011

Project Member
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=107261

------------------------------------------------------------------------
r107261 | mmenke@chromium.org | Tue Oct 25 17:50:30 PDT 2011

Changed paths:
 M http://src.chromium.org/viewvc/chrome/trunk/src/net/url_request/url_request_unittest.cc?r1=107261&r2=107260&pathrev=107261
 M http://src.chromium.org/viewvc/chrome/trunk/src/net/url_request/url_request.cc?r1=107261&r2=107260&pathrev=107261
 A http://src.chromium.org/viewvc/chrome/trunk/src/net/data/url_request_unittest/redirect301-to-echo?r1=107261&r2=107260&pathrev=107261
 A http://src.chromium.org/viewvc/chrome/trunk/src/net/data/url_request_unittest/redirect302-to-echo?r1=107261&r2=107260&pathrev=107261
 A http://src.chromium.org/viewvc/chrome/trunk/src/net/data/url_request_unittest/redirect303-to-echo?r1=107261&r2=107260&pathrev=107261
 A http://src.chromium.org/viewvc/chrome/trunk/src/net/data/url_request_unittest/redirect301-to-echo.mock-http-headers?r1=107261&r2=107260&pathrev=107261
 A http://src.chromium.org/viewvc/chrome/trunk/src/net/data/url_request_unittest/redirect302-to-echo.mock-http-headers?r1=107261&r2=107260&pathrev=107261
 A http://src.chromium.org/viewvc/chrome/trunk/src/net/data/url_request_unittest/redirect303-to-echo.mock-http-headers?r1=107261&r2=107260&pathrev=107261

Preserve non-POST methods on 301/302 requests.

BUG= 56373 
TEST=URLRequestTestHTTP.Redirect30*Tests

Review URL: http://codereview.chromium.org/8375002
------------------------------------------------------------------------

Comment 11 by mmenke@chromium.org, Oct 31 2011

Status: Fixed

Comment 12 by bugdroid1@chromium.org, Oct 13 2012

Project Member
Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.

Comment 13 by bugdroid1@chromium.org, Mar 10 2013

Project Member
Labels: -Area-Internals -Internals-Network-HTTP -Mstone-17 Cr-Internals-Network-HTTP Cr-Internals M-17

Comment 14 by bugdroid1@chromium.org, Mar 13 2013

Project Member
Labels: -Restrict-AddIssueComment-Commit Restrict-AddIssueComment-EditIssue

Comment 15 by efoo@chromium.org, Jul 6 2018

Components: Internals>Network

Comment 16 by efoo@chromium.org, Jul 6 2018

Components: -Internals>Network>HTTP

Sign in to add a comment