-
-
Notifications
You must be signed in to change notification settings - Fork 924
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
Our #
behavior in routing is invalid per spec
#2445
Comments
dead-claudia
added
Type: Bug
For bugs and any other unexpected breakage
m.request
labels
Jun 27, 2019
dead-claudia
added a commit
to dead-claudia/mithril.js
that referenced
this issue
Jul 3, 2019
- Valid URLs must not contain a `#` within its fragment. MithrilJS#2445 - Our docs were a little confusing and misleading - `m.pathname` isn't aware of URLs, just path names. - Removed the relevant extension to `m.parsePathname` required to support the hash parsing extension. Now we just shave it off and ignore it. - Fix support for arbitrary prefixes, so prefixes like `?#` are handled correctly. - Add a bunch of tests to cover various areas of confusion and unusual edge cases.
dead-claudia
added a commit
to dead-claudia/mithril.js
that referenced
this issue
Jul 3, 2019
- Valid URLs must not contain a `#` within its fragment. MithrilJS#2445 - Our docs were a little confusing and misleading - `m.pathname` isn't aware of URLs, just path names. - Removed the relevant extension to `m.parsePathname` required to support the hash parsing extension. Now we just shave it off and ignore it. - Fix support for arbitrary prefixes, so prefixes like `?#` are handled correctly. - Add a bunch of tests to cover various areas of confusion and unusual edge cases.
dead-claudia
added a commit
to dead-claudia/mithril.js
that referenced
this issue
Jul 3, 2019
- Valid URLs must not contain a `#` within its fragment. MithrilJS#2445 - Our docs were a little confusing and misleading - `m.pathname` isn't aware of URLs, just path names. - Removed the relevant extension to `m.parseQueryString` required to support the hash parsing extension. Now we just shave it off and ignore it. - Fix support for arbitrary prefixes, so prefixes like `?#` are handled correctly. - Add a bunch of tests to cover various areas of confusion and unusual edge cases.
11 tasks
dead-claudia
added a commit
that referenced
this issue
Jul 3, 2019
* Clarify pathname docs, follow spec with fragments - Valid URLs must not contain a `#` within its fragment. #2445 - Our docs were a little confusing and misleading - `m.pathname` isn't aware of URLs, just path names. - Removed the relevant extension to `m.parseQueryString` required to support the hash parsing extension. Now we just shave it off and ignore it. - Fix support for arbitrary prefixes, so prefixes like `?#` are handled correctly. - Add a bunch of tests to cover various areas of confusion and unusual edge cases. * Update with PR [skip ci]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mithril Version: v1.0.0 to v2.0.0-rc.6
Expected Behavior
Mithril to only tolerate valid URLs provided the prefix is valid
Current Behavior
Mithril can interpret
#!/foo/bar?one=1#two=2
as a valid URL when it isn't.Possible Solution
We should stop interpreting that
#
as part of the "parameters", to align with spec and to push users to use only valid URLs. 😉What we should be doing is aligning with how it's handled at the network level and just stripping it if it's present.
Steps to Reproduce
N/A - this is a design bug
Context
Discovered per here. Apparently, outside the Mithril world, people have already run into issues relying on the fact browsers tolerate multiple
#
s in URLs, but are apparently inconsistent in how they handle them at times.Also, this means we can save a few bytes in the pathname parsing.
Additional Information
Your Environment
The text was updated successfully, but these errors were encountered: