Bug 112194

Summary: REGRESSION(r137607): Redirecting a post to a get then reloading triggers resubmit warning
Product: WebKit Reporter: Nate Chapin <japhet>
Component: WebCore Misc.Assignee: Nate Chapin <japhet>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ap, gtk-ews, koivisto, philn, webkit.review.bot, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
Checking build fix on EWS
gtk-ews: commit-queue-
another ews experiment
none
Patch for landing none

Description Nate Chapin 2013-03-12 15:04:45 PDT
Original report: https://code.google.com/p/chromium/issues/detail?id=177855

From the original bug:

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Ubuntu Chromium/24.0.1312.56 Chrome/24.0.1312.56 Safari/537.17

Example URL:
http://demo.sperke.net/postredirect.php

Steps to reproduce the problem:
1. Open the link
2. Click the submit button
3. Your request will be sent and you are redirected with header code 303 to the same url
4. Hit the reload button

What is the expected behavior?
The page should reload.

What went wrong?
Chrome asks for resubmitting the form. That is wrong because the last request was a get and no post request. The values should not be resent.
Comment 1 Nate Chapin 2013-03-12 15:10:32 PDT
Created attachment 192820 [details]
patch
Comment 2 Alexey Proskuryakov 2013-03-12 15:42:09 PDT
Comment on attachment 192820 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=192820&action=review

> Source/WebCore/loader/SubresourceLoader.cpp:135
> +    if (!redirectResponse.isNull()) {

How can SubresourceLoader::willSendRequest be called with a null redirectResponse? Could you please post a stack trace?
Comment 3 Nate Chapin 2013-03-12 15:51:28 PDT
(In reply to comment #2)
> (From update of attachment 192820 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=192820&action=review
> 
> > Source/WebCore/loader/SubresourceLoader.cpp:135
> > +    if (!redirectResponse.isNull()) {
> 
> How can SubresourceLoader::willSendRequest be called with a null redirectResponse? Could you please post a stack trace?

It's called for the initial request from ResourceLoader::init(). For example:

STDERR:  [0x0000008ec390] WebCore::SubresourceLoader::willSendRequest()
STDERR:  [0x0000008e6b17] WebCore::ResourceLoader::init()
STDERR:  [0x0000008ec1fa] WebCore::SubresourceLoader::init()
STDERR:  [0x0000008ec09f] WebCore::SubresourceLoader::create()
STDERR:  [0x000000c2aec8] WebCore::ResourceLoadScheduler::scheduleSubresourceLoad()
STDERR:  [0x000000908ba7] WebCore::CachedResource::load()
STDERR:  [0x000000915b02] WebCore::CachedResourceLoader::requestResource()
STDERR:  [0x000000914e72] WebCore::CachedResourceLoader::requestMainResource()
STDERR:  [0x0000008db8dc] WebCore::MainResourceLoader::load()
STDERR:  [0x0000008a5939] WebCore::DocumentLoader::startLoadingMainResource()
Comment 4 Build Bot 2013-03-13 04:58:58 PDT
Comment on attachment 192820 [details]
patch

Attachment 192820 [details] did not pass win-ews (win):
Output: http://webkit-commit-queue.appspot.com/results/17038416
Comment 5 Nate Chapin 2013-03-13 09:36:13 PDT
Created attachment 192937 [details]
Checking build fix on EWS
Comment 6 kov's GTK+ EWS bot 2013-03-13 09:56:08 PDT
Comment on attachment 192937 [details]
Checking build fix on EWS

Attachment 192937 [details] did not pass gtk-ews (gtk):
Output: http://webkit-commit-queue.appspot.com/results/17133064
Comment 7 Build Bot 2013-03-13 10:10:37 PDT
Comment on attachment 192937 [details]
Checking build fix on EWS

Attachment 192937 [details] did not pass win-ews (win):
Output: http://webkit-commit-queue.appspot.com/results/17178331
Comment 8 Nate Chapin 2013-03-13 10:28:18 PDT
Created attachment 192944 [details]
another ews experiment
Comment 9 Nate Chapin 2013-03-13 11:48:35 PDT
Created attachment 192955 [details]
Patch for landing
Comment 10 WebKit Review Bot 2013-03-13 12:16:47 PDT
Comment on attachment 192955 [details]
Patch for landing

Clearing flags on attachment: 192955

Committed r145735: <http://trac.webkit.org/changeset/145735>
Comment 11 WebKit Review Bot 2013-03-13 12:16:52 PDT
All reviewed patches have been landed.  Closing bug.