Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1925)

Unified Diff: webkit/child/weburlloader_impl.cc

Issue 143903003: Disable HTTP authentication dialog for XHR with credentials (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add browser tests Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/login/xhr_without_credentials.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/child/weburlloader_impl.cc
diff --git a/webkit/child/weburlloader_impl.cc b/webkit/child/weburlloader_impl.cc
index 9ecf69a883f1aad21dbb377b364796210b96cd36..54827b6cf8cb5d1c534a78310b8f1af78d7d8a47 100644
--- a/webkit/child/weburlloader_impl.cc
+++ b/webkit/child/weburlloader_impl.cc
@@ -360,6 +360,11 @@ void WebURLLoaderImpl::Context::Start(
if (!request.allowStoredCredentials())
load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA;
+ if (request.targetType() == WebURLRequest::TargetIsXHR &&
+ (url.has_username() || url.has_password())) {
+ load_flags |= net::LOAD_DO_NOT_PROMPT_FOR_LOGIN;
+ }
+
HeaderFlattener flattener(load_flags);
request.visitHTTPHeaderFields(&flattener);
« no previous file with comments | « chrome/test/data/login/xhr_without_credentials.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698