Skip to content

Instantly share code, notes, and snippets.

@fischman
Created June 5, 2012 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fischman/2877666 to your computer and use it in GitHub Desktop.
Save fischman/2877666 to your computer and use it in GitHub Desktop.
diff --git a/Source/WebKit/chromium/src/AssociatedURLLoader.cpp b/Source/WebKit/chromium/src/AssociatedURLLoader.cpp
index f1c2aab..e466f4d 100644
--- a/Source/WebKit/chromium/src/AssociatedURLLoader.cpp
+++ b/Source/WebKit/chromium/src/AssociatedURLLoader.cpp
@@ -32,6 +32,7 @@
#include "AssociatedURLLoader.h"
#include "CrossOriginAccessControl.h"
+#include "Document.h"
#include "DocumentThreadableLoader.h"
#include "DocumentThreadableLoaderClient.h"
#include "HTTPValidation.h"
@@ -346,8 +347,10 @@ void AssociatedURLLoader::loadAsynchronously(const WebURLRequest& request, WebUR
options.crossOriginRequestPolicy = static_cast<WebCore::CrossOriginRequestPolicy>(m_options.crossOriginRequestPolicy);
options.shouldBufferData = DoNotBufferData;
- const ResourceRequest& webcoreRequest = newRequest.toResourceRequest();
+ ResourceRequest& webcoreRequest = newRequest.toMutableResourceRequest();
Document* webcoreDocument = m_frameImpl->frame()->document();
+ if (options.crossOriginRequestPolicy == WebCore::UseAccessControl)
+ updateRequestForAccessControl(webcoreRequest, webcoreDocument->securityOrigin(), options.allowCredentials);
m_loader = DocumentThreadableLoader::create(webcoreDocument, m_clientAdapter.get(), webcoreRequest, options);
} else {
// FIXME: return meaningful error codes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment