Bug 21242 - [CURL] Should handle redirects in WebCore
: [CURL] Should handle redirects in WebCore
Status: NEW
Product: WebKit
Classification: Unclassified
Component: New Bugs
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To: Nobody
http://software.hixie.ch/utilities/cg...
: Curl
Depends on:
Blocks: 117300
  Show dependency treegraph
 
Reported: 2008-09-30 08:19 PDT by Alp Toker
Modified: 2015-01-06 11:03 PST (History)
7 users (show)

See Also:


Attachments
First draft (7.80 KB, patch)
2014-01-24 02:21 PST, Szabolcs David
bfulgham: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alp Toker 2008-09-30 08:19:16 PDT
CURL's ResourceHandleManager currently sets:

curl_easy_setopt(d->m_handle, CURLOPT_FOLLOWLOCATION, 1);

This means that HTTP redirects are handled behind the scenes by CURL. This incorrectly bypasses WebCore functionality and makes it difficult to fire the right signals and policy events at the right time. Moreover, it also bypasses WebCore's resources and data URL parsing capabilities.

http://software.hixie.ch/utilities/cgi/data/data is an example of a page that redirects to a data URL that's currently not working.

Patch coming up.
Comment 1 Gustavo Noronha (kov) 2009-02-27 20:04:19 PST
Removing the Gtk keyword, since GTK+ doesn't use curl anymore.
Comment 2 Brent Fulgham 2013-09-12 11:05:54 PDT
Too bad that patch never got added!  :-)
Comment 3 Szabolcs David 2013-09-13 03:26:00 PDT
We are currently working on it. : ) I already have a working implementation, so patch is coming soon.
Comment 4 Csaba Osztrogonác 2013-09-13 03:38:48 PDT
(In reply to comment #3)
> We are currently working on it. : ) I already have a working implementation, so patch is coming soon.

Great, this bug should be assigned to you in this case.
Comment 5 Szabolcs David 2014-01-24 02:21:38 PST
Created attachment 222089 [details]
First draft

Sorry for the delay. I have worked on this, but I have been moved to another project and I won't have time work on this anymore.
Comment 6 Brent Fulgham 2014-01-30 10:05:11 PST
Comment on attachment 222089 [details]
First draft

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

This seems fine to me, but someone using the Curl backend more frequently should confirm it doesn't cause any problems.

> Source/WebCore/platform/network/curl/ResourceHandleManager.cpp:404
> +    String location = d->m_response.httpHeaderField("location");

This could probably be a const String&
Comment 7 Brent Fulgham 2014-01-30 10:05:33 PST
+peavo
Comment 8 peavo 2014-01-30 13:16:55 PST
(In reply to comment #7)
> +peavo

Will give it a test.
Comment 9 peavo 2014-01-31 09:25:42 PST
On Windows, I seem to be having some problems logging into hotmail with this patch.
There seems to be a redirect, but after that nothing happens, and the displayed page is empty, not sure why, though.
Comment 10 peavo 2014-01-31 09:51:30 PST
(In reply to comment #9)
> On Windows, I seem to be having some problems logging into hotmail with this patch.
> There seems to be a redirect, but after that nothing happens, and the displayed page is empty, not sure why, though.

I'm sorry, disregard my last comment. This behavior is exactly the same without the patch, so it must be caused by other changes.
Comment 11 peavo 2014-12-30 14:44:15 PST
Should we commit this one?
Comment 12 peavo 2015-01-06 11:03:40 PST
(In reply to comment #11)
> Should we commit this one?

I've been running with this patch, and have had some crashes in the network backend because the ResourceHandleClient has been used after deletion.