Bug 111083 - [BlackBerry] Set-Cookie headers received while loading is deferred should be processed immediately
Summary: [BlackBerry] Set-Cookie headers received while loading is deferred should be ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Other
: P2 Normal
Assignee: Joe Mason
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-28 09:23 PST by Joe Mason
Modified: 2013-02-28 10:55 PST (History)
4 users (show)

See Also:


Attachments
fix (5.15 KB, patch)
2013-02-28 09:34 PST, Joe Mason
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Mason 2013-02-28 09:23:01 PST
While loading is deferred, incoming headers are buffered until loading resumes. But new requests (which need to read cookie headers) can be created, and these are expected to include the cookies from those requests.

A specific scenario is when request receives a 401 response with a Set-Cookie header is received. First NetworkJob is signalled that there was an authentication failure and credentials are needed, so it opens a password dialog and defers loading until it is closed. Then the headers and data from the response arrive and are buffered. After the user closes the dialog, first the credentials are processed - meaning a followup request is created, identical to the original but with new Cookie and Authorization headers - and then loading is resumed - and now the Set-Cookie headers are processed.

Since some custom auth schemes depend on setting a cookie with the 401 response and receiving it back with the followup, the cookies from the Set-Cookie headers must be added to the cookie jar before creating the followup request, even if loading is deferred due to the auth dialog.
Comment 1 Joe Mason 2013-02-28 09:34:35 PST
Created attachment 190740 [details]
fix
Comment 2 Yong Li 2013-02-28 10:29:44 PST
Comment on attachment 190740 [details]
fix

based on Leo's review
Comment 3 WebKit Review Bot 2013-02-28 10:55:04 PST
Comment on attachment 190740 [details]
fix

Clearing flags on attachment: 190740

Committed r144326: <http://trac.webkit.org/changeset/144326>
Comment 4 WebKit Review Bot 2013-02-28 10:55:08 PST
All reviewed patches have been landed.  Closing bug.