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

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

Issue 1266963002: Correctly construct ("file", "", 0) SecurityOrigins. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@plugin
Patch Set: Created 5 years, 5 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
Index: Source/platform/weborigin/SecurityOrigin.cpp
diff --git a/Source/platform/weborigin/SecurityOrigin.cpp b/Source/platform/weborigin/SecurityOrigin.cpp
index e693e280f14fb8eaf7d985a100c7ef0fb402dbb0..c979d83d7b2bf463fa237768070d6e553b813264 100644
--- a/Source/platform/weborigin/SecurityOrigin.cpp
+++ b/Source/platform/weborigin/SecurityOrigin.cpp
@@ -510,7 +510,8 @@ PassRefPtr<SecurityOrigin> SecurityOrigin::create(const String& protocol, const
if (port < 0 || port > MaxAllowedPort)
return createUnique();
String decodedHost = decodeURLEscapeSequences(host);
- return create(KURL(KURL(), protocol + "://" + host + ":" + String::number(port) + "/"));
+ String portPart = port ? ":" + String::number(port) : String();
+ return create(KURL(KURL(), protocol + "://" + host + portPart + "/"));
}
bool SecurityOrigin::isSameSchemeHostPort(const SecurityOrigin* other) const
« no previous file with comments | « no previous file | Source/platform/weborigin/SecurityOriginTest.cpp » ('j') | Source/platform/weborigin/SecurityOriginTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698