medialize / medialize/URI.js

Different results between 1.19.1 and 1.19.2 when using uri.scheme

Open
#391 4 comments 2 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.