diff options
Diffstat (limited to 'dom')
-rw-r--r-- | dom/base/Location.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/dom/base/Location.cpp b/dom/base/Location.cpp index 7b3722f09..5f8738298 100644 --- a/dom/base/Location.cpp +++ b/dom/base/Location.cpp @@ -730,6 +730,23 @@ Location::SetProtocol(const nsAString& aProtocol) if (NS_FAILED(rv)) { return rv; } + + bool isHttp; + rv = uri->SchemeIs("http", &isHttp); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + bool isHttps; + rv = uri->SchemeIs("https", &isHttps); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + if (!isHttp && !isHttps) { + // No-op, per spec. + return NS_OK; + } return SetURI(uri); } |