New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add comments linking to the steps of the specs in the checks on Location setters #25714
Changes from 1 commit
9845249
3c8df69
97e967c
3f2abcc
6c31813
05f7547
214fbc9
ad31fde
ec77231
File filter...
Jump to…
only allow http/https protocols
- Loading branch information
Verified
| @@ -217,7 +217,11 @@ impl LocationMethods for Location { | ||
| // https://html.spec.whatwg.org/multipage/#dom-location-protocol | ||
| fn SetProtocol(&self, value: USVString) -> ErrorResult { | ||
| self.check_same_origin_domain()?; | ||
| self.set_url_component(value, UrlHelper::SetProtocol); | ||
| // If copyURL's scheme is not an HTTP(S) scheme, then terminate these steps. | ||
| let scheme = value.split(':').next().unwrap(); | ||
gterzian
Member
|
||
| if scheme.eq_ignore_ascii_case("http") || scheme.eq_ignore_ascii_case("https") { | ||
| self.set_url_component(value, UrlHelper::SetProtocol); | ||
| } | ||
| Ok(()) | ||
| } | ||
|
|
||
Isn’t it dangerous to have
unwrap()here?