+2013-02-28 Joe Mason <jmason@rim.com>
+
+ [BlackBerry] Handle Set-Cookie immediately even when loading is deferred
+ https://bugs.webkit.org/show_bug.cgi?id=111083
+
+ Reviewed by Yong Li.
+
+ Internal PR: 298805
+ Internally Reviewed By: Leo Yang
+
+ Handle Set-Cookie headers immediately, even if loading is being deferred, since any request
+ created while loading is deferred should include all cookies received. (This especially
+ affects Set-Cookie headers sent with a 401 response - often this causes an auth dialog to be
+ opened, which defers loading, but the followup request using the credentials from the dialog
+ needs to include the cookie.)
+
+ This is safe because handleSetCookieHeader only updates the cookiejar, it doesn't call back
+ into the loader.
+
+ * platform/network/blackberry/NetworkJob.cpp:
+ (WebCore::NetworkJob::notifyHeadersReceived):
+ (WebCore::NetworkJob::handleNotifyHeaderReceived):
+
2013-02-28 David Grogan <dgrogan@chromium.org>
IndexedDB: IO error when checking schema should destroy LevelDB directory
void NetworkJob::notifyHeadersReceived(const BlackBerry::Platform::NetworkRequest::HeaderList& headers)
{
+ bool cookiesEnabled = m_frame && m_frame->loader() && m_frame->loader()->client()
+ && static_cast<FrameLoaderClientBlackBerry*>(m_frame->loader()->client())->cookiesEnabled();
+
BlackBerry::Platform::NetworkRequest::HeaderList::const_iterator endIt = headers.end();
for (BlackBerry::Platform::NetworkRequest::HeaderList::const_iterator it = headers.begin(); it != endIt; ++it) {
+
+ // Handle Set-Cookie headers immediately, even if loading is being deferred, since any request
+ // created while loading is deferred should include all cookies received. (This especially
+ // affects Set-Cookie headers sent with a 401 response - often this causes an auth dialog to be
+ // opened, which defers loading, but the followup request using the credentials from the dialog
+ // needs to include the cookie.)
+ //
+ // This is safe because handleSetCookieHeader only updates the cookiejar, it doesn't call back
+ // into the loader.
+ String keyString(it->first);
+ if (cookiesEnabled && equalIgnoringCase(keyString, "set-cookie"))
+ handleSetCookieHeader(it->second);
+
if (shouldDeferLoading())
m_deferredData.deferHeaderReceived(it->first, it->second);
else {
- String keyString(it->first);
String valueString;
if (equalIgnoringCase(keyString, "Location")) {
// Location, like all headers, is supposed to be Latin-1. But some sites (wikipedia) send it in UTF-8.
m_contentType = value.lower();
else if (lowerKey == "content-disposition")
m_contentDisposition = value;
- else if (lowerKey == "set-cookie" && m_frame && m_frame->loader() && m_frame->loader()->client()
- && static_cast<FrameLoaderClientBlackBerry*>(m_frame->loader()->client())->cookiesEnabled())
- handleSetCookieHeader(value);
else if (equalIgnoringCase(key, BlackBerry::Platform::NetworkRequest::HEADER_BLACKBERRY_FTP))
handleFTPHeader(value);