Skip to content
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

Bug with url.format and object contain colon #67

Closed
eduardoPavon opened this issue Sep 14, 2023 · 1 comment
Closed

Bug with url.format and object contain colon #67

eduardoPavon opened this issue Sep 14, 2023 · 1 comment

Comments

@eduardoPavon
Copy link

Hello,

It seems there's a bug in the new version of the library '0.11.2'. In this update, consistency was maintained among the array-type parameters. However, it seems this consistency has been broken for parameters that make use of colons (:)

Example:

import * as url0 from "https://cdn.skypack.dev/url@0.11.0";
import * as url1 from "https://cdn.skypack.dev/url@0.11.1";
import * as url2 from "https://cdn.skypack.dev/url@0.11.2";

const query = {"custom:id":"12"}

const data = {
    protocol: window.location.protocol,
    host: window.location.host,
    pathname: 'test',
    query: query,
  }
console.log({
  url0: url0.format(data),
  url1: url1.format(data),
  url2: url2.format(data)
});

Output:

{
    "url0": "https://cdpn.io/test?custom%3Aid=12",
    "url1": "https://cdpn.io/test?custom%3Aid=12",
    "url2": "https://cdpn.io/test?custom:id=12"
}
@ljharb
Copy link
Collaborator

ljharb commented Sep 14, 2023

hmm, that's caused by encodeValuesOnly. I'm not sure why i added that in 4cec245; i'll add a test and remove it.

@ljharb ljharb closed this as completed in c3e0a5d Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants