Bug 21242 - [CURL] Should handle redirects in WebCore
: [CURL] Should handle redirects in WebCore
Status: NEW
: WebKit
New Bugs
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To:
: http://software.hixie.ch/utilities/cg...
: Curl
:
: 117300
  Show dependency treegraph
 
Reported: 2008-09-30 08:19 PST by
Modified: 2014-01-31 09:51 PST (History)


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


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-09-30 08:19:16 PST
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 From 2009-02-27 20:04:19 PST -------
Removing the Gtk keyword, since GTK+ doesn't use curl anymore.
------- Comment #2 From 2013-09-12 11:05:54 PST -------
Too bad that patch never got added!  :-)
------- Comment #3 From 2013-09-13 03:26:00 PST -------
We are currently working on it. : ) I already have a working implementation, so patch is coming soon.
------- Comment #4 From 2013-09-13 03:38:48 PST -------
(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 From 2014-01-24 02:21:38 PST -------
Created an attachment (id=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 From 2014-01-30 10:05:11 PST -------
(From update of attachment 222089 [details])
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 From 2014-01-30 10:05:33 PST -------
+peavo
------- Comment #8 From 2014-01-30 13:16:55 PST -------
(In reply to comment #7)
> +peavo

Will give it a test.
------- Comment #9 From 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 From 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.