Bug 35301 - [Qt] HTTP 307 after a 303 after a POST re-sends POST data from the original request
Summary: [Qt] HTTP 307 after a 303 after a POST re-sends POST data from the original r...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: QtWebKit Unassigned
Keywords: Qt, QtTriaged
Depends on:
Reported: 2010-02-23 09:33 PST by Brady Eidson
Modified: 2010-06-25 11:11 PDT (History)
3 users (show)

See Also:

Patch (3.18 KB, patch)
2010-06-22 13:02 PDT, Robert Hogan
no flags Details | Formatted Diff | Diff
Patch (4.11 KB, patch)
2010-06-24 13:54 PDT, Robert Hogan
kenneth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2010-02-23 09:33:07 PST
HTTP 307 after a 303 after a POST re-sends POST data from the original request.

See https://bugs.webkit.org/show_bug.cgi?id=31410 for more discussion and the fix that went in for Mac and Windows.

Qt needs to do the same.
Comment 1 Tor Arne Vestbø 2010-03-10 06:42:54 PST
Please follow the QtWebKit bug reporting guidelines when reporting bugs.

See http://trac.webkit.org/wiki/QtWebKitBugs


  - The 'QtWebKit' component should only be used for bugs/features in the
    public QtWebKit API layer, not to signify that the bug is specific to
    the Qt port of WebKit


  - Add the keyword 'Qt' to signal that it's a Qt-related bug

Comment 2 Robert Hogan 2010-06-22 13:02:12 PDT
Created attachment 59407 [details]
Comment 3 Kenneth Rohde Christiansen 2010-06-22 14:36:18 PDT
Comment on attachment 59407 [details]

uh, seems like a QtNetwork bug. If you do this change, please add a comment and at best a link to the qt bug report.
Comment 4 Robert Hogan 2010-06-24 13:02:43 PDT
(In reply to comment #3)
> (From update of attachment 59407 [details])
> uh, seems like a QtNetwork bug. 

I don't think it is - the reason checking m_method doesn't work for this test is because there are two redirects following an initial POST.

The first one is managed successfully: the m_method for the original request is POST, the check detects this and overrides it with GET. For the second redirect, the check sees that m_method is now GET so it doesn't override the method in the newRequest it has created from ResourceHandle::request() (which is still the original value of POST) with GET.

So during a redirect chain QNetworkReplyHandler needs to check the httpMethod() or lastHTTPMethod() rather than the m_method, because that will always contain the original request method in a redirect chain.

I'll update the changelog with this and use httpMethod() instead - lastHTTPMethod() is Mac-specific really.
Comment 5 Robert Hogan 2010-06-24 13:54:20 PDT
Created attachment 59699 [details]
Comment 6 Robert Hogan 2010-06-25 11:11:32 PDT
Committed r61875: <http://trac.webkit.org/changeset/61875>