Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upPublic urlutils and check type in set_scheme #83
Conversation
…mpatible type
|
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
valenting commentedFeb 24, 2015
Make urlutils public and disallow changing the scheme type to an incompatible type