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

Unified Diff: Source/core/html/HTMLAnchorElement.cpp

Issue 300543002: Allow filename suggestions via a[download] for data URIs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | « LayoutTests/http/tests/security/anchor-download-allow-data-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLAnchorElement.cpp
diff --git a/Source/core/html/HTMLAnchorElement.cpp b/Source/core/html/HTMLAnchorElement.cpp
index 7f585364663eea2a28813e9b30cf72140c82693f..11c8f4f9ad989999d65d413106842afebdb44838 100644
--- a/Source/core/html/HTMLAnchorElement.cpp
+++ b/Source/core/html/HTMLAnchorElement.cpp
@@ -384,7 +384,7 @@ void HTMLAnchorElement::handleClick(Event* event)
request.setHTTPReferrer(Referrer(referrer, document().referrerPolicy()));
}
- bool isSameOrigin = document().securityOrigin()->canRequest(completedURL);
+ bool isSameOrigin = completedURL.protocolIsData() || document().securityOrigin()->canRequest(completedURL);
const AtomicString& suggestedName = (isSameOrigin ? fastGetAttribute(downloadAttr) : nullAtom);
frame->loader().client()->loadURLExternally(request, NavigationPolicyDownload, suggestedName);
« no previous file with comments | « LayoutTests/http/tests/security/anchor-download-allow-data-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698