RESOLVED FIXED 163436
Document request not updated after willSendRequest is called for a redirect
https://bugs.webkit.org/show_bug.cgi?id=163436
Summary Document request not updated after willSendRequest is called for a redirect
Carlos Garcia Campos
Reported 2016-10-14 01:55:08 PDT
Adding unit tests for bug #146306 in the GTK+ port I've noticed that patch for bug #146306 still doesn't work when a request is modified by willSendRequest after a redirect. The thing is that DocumentLoader::setRequest is not called after willSendRequest is called for a redirect. The first willSendRequest happens before DocumentLoader::startLoadingMainResource, that calls setRequest, but the second one happens after DocumentLoader::redirectReceived() and then the request is never updated again.
Attachments
Patch (11.75 KB, patch)
2016-10-14 02:02 PDT, Carlos Garcia Campos
mcatanzaro: review+
Carlos Garcia Campos
Comment 1 2016-10-14 02:02:32 PDT
Created attachment 291595 [details] Patch Added unit tests for GTK+ only, because I'm not sure it's even possible to test a server redirect with the cross-platform C API unit tests.
Michael Catanzaro
Comment 2 2016-10-14 11:15:22 PDT
(In reply to comment #1) > Created attachment 291595 [details] > Patch > > Added unit tests for GTK+ only, because I'm not sure it's even possible to > test a server redirect with the cross-platform C API unit tests. I think it's not currently possible, because we have no cross-platform equivalent to SoupServer.
Michael Catanzaro
Comment 3 2016-10-14 11:31:04 PDT
Comment on attachment 291595 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=291595&action=review Great tests. > Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp:225 > + enum State { Provisional, ProvisionalAfterRedirect, Commited, Finished }; Personally, I'd still favor using enum class even in a file-private unit test class, but your call. > Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp:254 > + void checkURIAtState(State state, const char* uri) Please rename the second parameter (maybe to "path") because it's not a URI.
Carlos Garcia Campos
Comment 4 2016-10-16 01:38:08 PDT
Note You need to log in before you can comment on or make changes to this bug.