diff options
author | Alexandrov Sergey <splavgm@gmail.com> | 2020-05-17 13:50:11 +0300 |
---|---|---|
committer | Alexandrov Sergey <splavgm@gmail.com> | 2020-05-19 20:06:59 +0300 |
commit | 357b48645599574d6b6d9a3f94e3c6bd9a9cf66e (patch) | |
tree | 040b555ab226a249fce4f194ba9ae4f66bdfbfd4 /components/script/dom/urlhelper.rs | |
parent | a7c5c976161320dc5d3983cbd8d70229c633afd5 (diff) | |
download | servo-357b48645599574d6b6d9a3f94e3c6bd9a9cf66e.tar.gz servo-357b48645599574d6b6d9a3f94e3c6bd9a9cf66e.zip |
make is_origin_trustworthy a method of ServoUrl + fix localhost handling
Diffstat (limited to 'components/script/dom/urlhelper.rs')
-rw-r--r-- | components/script/dom/urlhelper.rs | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/components/script/dom/urlhelper.rs b/components/script/dom/urlhelper.rs index b03ce4c3f9d..834d7e20d18 100644 --- a/components/script/dom/urlhelper.rs +++ b/components/script/dom/urlhelper.rs @@ -72,23 +72,4 @@ impl UrlHelper { pub fn SetUsername(url: &mut ServoUrl, value: USVString) { let _ = quirks::set_username(url.as_mut_url(), &value.0); } - // https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy - pub fn is_origin_trustworthy(url: &ServoUrl) -> bool { - // Step 1 - if !url.origin().is_tuple() { - return false; - } - - // Step 3 - if url.scheme() == "https" || url.scheme() == "wss" { - true - // Step 4 - } else if url.host().is_some() { - let host = url.host_str().unwrap(); - host == "127.0.0.0/8" || host == "::1/128" - // Step 6 - } else { - url.scheme() == "file" - } - } } |