Different results between 1.19.1 and 1.19.2 when using uri.scheme
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6.2k
- Forks
- 468
- PR merge metrics
- No merged PRs in 30d
Description
When running
const uri = urijs(href)
console.log(href, defaultScheme)
uri.scheme(defaultScheme)
console.log(uri.toString())
in version 1.19.1 the console reads:
example.com https
https://example.com
Which is what's intended, however, in version 1.19.2 it reads:
example.com https
https:///example.com
looks like there's an extra / getting in there somehow?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported snippet with URI.js 1.19.1 and 1.19.2 using the input example.com and scheme https. Trace how uri.scheme(defaultScheme) is serialized by uri.toString(), then add a regression test that preserves https://example.com without the extra slash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100