-
Notifications
You must be signed in to change notification settings - Fork 335
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
Public urlutils and check type in set_scheme #83
Conversation
I’m not sure about disallowing the changes. In the test case below, no two of the browsers tested are interoperable but they all do change the scheme: http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=3428 <a href="mailto:a@b.net">
<script>
var a = document.body.firstChild;
console.log(a.href);
a.protocol = "http";
console.log(a.href)
</script> In Chromium:
In old Opera (Presto):
In Firefox:
|
One of the ssues we've had in Firefox is setters that make the URL go into an invalid state.
There are probably hundreds of these examples. Sometimes harmless, sometimes a big security risk. IMO the only way of safely changing the scheme is enforcing they the same type. PS. there are things we don't allow in Firefox. Like this:
|
I’ve filed https://www.w3.org/Bugs/Public/show_bug.cgi?id=28091 on the spec about this. |
Ok, in the spec, a "relative flag" is maintained separately from the scheme. So in this test case, you’d end up with an URL in the |
We could also reparse the url after setting the scheme, and roll it back if that fails. |
Ideally we’d do what the spec says, and if that’s not good we should convince Anne to change the spec. |
Alright, let's take this for now. I filed #85 about this issue, if we want to revsisit later. |
Public urlutils and check type in set_scheme
Make urlutils public and disallow changing the scheme type to an incompatible type