URL Regex for SemVer doesn't match suffixed version names (alpha, beta, etc.)
See original GitHub issueNavigating to eslint@6.0.0-rc.0
(alpha, beta, etc. as well) causes a redirect that 404s because of a duplicated version suffix.
# Inputed clean URL
https://runpkg.com/?eslint@6.0.0-rc.0
# Redirect with extra `-rc.0` suffix
https://runpkg.com/?eslint@6.0.0-rc.0-rc.0/lib/api.js
I’ve narrowed it down to the regex on Nav.js which will never match the suffixes, and will history.pushState
the full version (selectedVersion = "6.0.0-rc.0"
) concatenated with suffix again in the path (path = "-rc.0/lib/api.js"
).
Since the version doesn’t seem to be validated, is it possible to reuse something similar to index.js
’s parseUrl()
which parses by using the path slashes?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
regex for semver - semantic versioning - Stack Overflow
Is there a suggested regular expression (RegEx) to check a SemVer string? ... This is a somewhat simpler version missing the capture groups ......
Read more >PEP 440 – Version Identification and Dependency Specification
Public version identifiers MUST be unique within a given distribution. Installation tools SHOULD ignore any public versions which do not comply with this...
Read more >[policy, no patch] Switch to Semantic Versioning for Drupal ...
Yes, I agree it's not completely semantic versioning, ... There's no more dev/alpha/beta denoted in the filename or the version string
Read more >Regex for semantic versioning - iHateRegex
Match a SemVer as specified in https://semver.org/ ... 1.2.3-SNAPSHOT-123 1.0.0 2.0.0+build.1848 2.0.1-alpha.1227 1.0.0-alpha+beta 1.0.0-alpha_beta ...
Read more >python packaging version
You dont have to append For example, if you had chosen the "b", or "rc") and the prerelease number (an integer). : Allows...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I got the excitement jitters from being able to track down the cause of this issue quickly (and hopefully accurately 😅), so I’d love to contribute a PR for this when confirmed if that would be helpful.
Awesome! I made a pull request with the fix and a test.