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

Unified Diff: Source/platform/weborigin/KURL.cpp

Issue 874393006: Clear username and password from location.href when basic HTTP (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add LayoutTests. Created 5 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 | « Source/platform/weborigin/KURL.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/weborigin/KURL.cpp
diff --git a/Source/platform/weborigin/KURL.cpp b/Source/platform/weborigin/KURL.cpp
index dd47d75e2afc02f70087559cbe9c06be0fcb29e9..728463711e62643b9d0195dcc74d3ca5514f0174 100644
--- a/Source/platform/weborigin/KURL.cpp
+++ b/Source/platform/weborigin/KURL.cpp
@@ -143,6 +143,17 @@ String KURL::strippedForUseAsReferrer() const
return string();
}
+String KURL::strippedForUseAsHref() const
+{
+ if (m_parsed.username.is_nonempty() || m_parsed.password.is_nonempty()) {
+ KURL href(*this);
+ href.setUser(String());
+ href.setPass(String());
+ return href.string();
+ }
+ return string();
+}
+
bool KURL::isLocalFile() const
{
// Including feed here might be a bad idea since drag and drop uses this check
« no previous file with comments | « Source/platform/weborigin/KURL.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698