WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
41571
[Qt] Fix http/tests/loading/redirect-methods.html
https://bugs.webkit.org/show_bug.cgi?id=41571
Summary
[Qt] Fix http/tests/loading/redirect-methods.html
Robert Hogan
Reported
2010-07-03 14:13:30 PDT
and document our redirection behaviour.
Attachments
Patch
(6.07 KB, patch)
2010-07-03 14:27 PDT
,
Robert Hogan
no flags
Details
Formatted Diff
Diff
Patch
(4.61 KB, patch)
2010-09-06 14:00 PDT
,
Robert Hogan
no flags
Details
Formatted Diff
Diff
Patch
(4.70 KB, patch)
2010-09-27 13:25 PDT
,
Robert Hogan
no flags
Details
Formatted Diff
Diff
Patch
(4.38 KB, patch)
2010-09-27 13:58 PDT
,
Robert Hogan
no flags
Details
Formatted Diff
Diff
Patch
(4.37 KB, patch)
2010-09-30 14:03 PDT
,
Robert Hogan
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Robert Hogan
Comment 1
2010-07-03 14:27:25 PDT
Created
attachment 60459
[details]
Patch
Kenneth Rohde Christiansen
Comment 2
2010-07-03 15:23:52 PDT
Brady, can you have a look at this?
Adam Barth
Comment 3
2010-07-07 03:52:43 PDT
Comment on
attachment 60459
[details]
Patch I know how all this stuff is supposed to work, but I'm too tired right now to remember. If you don't get a review soon, feel free to ping me and I'll look in more detail. In general, what the RFC says about this stuff is bogus. :(
Adam Barth
Comment 4
2010-07-27 07:30:36 PDT
Comment on
attachment 60459
[details]
Patch Your comment is making me think you don't know this history of this topic. How to handle these redirects is a somewhat sad tale. The requirements for these status codes are changing in the next generation of the HTTP spec to more closely align with reality. I need to look up the proper behavior, but POST shouldn't be special-cased. I think HEAD (and possibly OPTIONS) are the only ones with special cases.
Robert Hogan
Comment 5
2010-07-27 13:31:52 PDT
(In reply to
comment #4
)
> (From update of
attachment 60459
[details]
) > Your comment is making me think you don't know this history of this topic. How to handle these redirects is a somewhat sad tale. The requirements for these status codes are changing in the next generation of the HTTP spec to more closely align with reality. > > I need to look up the proper behavior, but POST shouldn't be special-cased. I think HEAD (and possibly OPTIONS) are the only ones with special cases.
So the code is wrong as well as the comments? I thought http/tests/loading/redirect-methods.html and others were all about handling cases where POST was used and multiple redirects followed. I'm confused now.
Robert Hogan
Comment 6
2010-09-06 14:00:38 PDT
Created
attachment 66668
[details]
Patch
Robert Hogan
Comment 7
2010-09-06 14:02:10 PDT
(In reply to
comment #4
)
> (From update of
attachment 60459
[details]
) > Your comment is making me think you don't know this history of this topic. How to handle these redirects is a somewhat sad tale. The requirements for these status codes are changing in the next generation of the HTTP spec to more closely align with reality. > > I need to look up the proper behavior, but POST shouldn't be special-cased. I think HEAD (and possibly OPTIONS) are the only ones with special cases.
I've resubmitted and removed the comments about the RFC. I just describe what we do in order to pass the layout tests.
Adam Barth
Comment 8
2010-09-27 10:54:26 PDT
Comment on
attachment 66668
[details]
Patch I don't think this is quite right. You shouldn't need m_receivedPermanentRedirect. What happens is that the first 301 (or whatever) changes the method to GET. By the time you get to the 307, you shouldn't have a POST method anymore. 307 should always preserve the method of the request that received the 307. That's the whole point of 307 existing.
Robert Hogan
Comment 9
2010-09-27 12:46:38 PDT
(In reply to
comment #8
)
> (From update of
attachment 66668
[details]
) > I don't think this is quite right. You shouldn't need m_receivedPermanentRedirect. What happens is that the first 301 (or whatever) changes the method to GET.
Yes.
>By the time you get to the 307, you shouldn't have a POST method anymore.
We do. We have it in the original request (m_resourceHandle->firstRequest()), which is what QNetworkReplyHandler inspects here. We don't currently keep a record of the most recent method sent in response to a redirect.
>307 should always preserve the method of the request that received the 307. That's the whole point of 307 existing.
OK. The patch does that though - by reinstating the GET used for the previous 301-303, if that was what was used. The code in sendResponseIfNeeded() isn't very clear so I'll refactor it.
Robert Hogan
Comment 10
2010-09-27 13:25:15 PDT
Created
attachment 68949
[details]
Patch
Early Warning System Bot
Comment 11
2010-09-27 13:35:28 PDT
Attachment 68949
[details]
did not build on qt: Build output:
http://queues.webkit.org/results/4057156
Robert Hogan
Comment 12
2010-09-27 13:58:30 PDT
Created
attachment 68951
[details]
Patch
Adam Barth
Comment 13
2010-09-30 11:19:03 PDT
Comment on
attachment 68951
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=68951&action=review
Looks great! Thanks.
> WebCore/platform/network/qt/QNetworkReplyHandler.cpp:393 > + if ((statusCode >= 301 && statusCode <= 303) && m_resourceHandle->firstRequest().httpMethod() == "POST")
You've got an extra space in "&& m_resourceHandle"
Robert Hogan
Comment 14
2010-09-30 14:03:37 PDT
Created
attachment 69379
[details]
Patch
WebKit Commit Bot
Comment 15
2010-10-01 11:40:31 PDT
Comment on
attachment 69379
[details]
Patch Clearing flags on attachment: 69379 Committed
r68906
: <
http://trac.webkit.org/changeset/68906
>
WebKit Commit Bot
Comment 16
2010-10-01 11:40:38 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug