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

Incorrect URL being generated #100

Open
ahnv opened this issue Aug 16, 2024 · 0 comments
Open

Incorrect URL being generated #100

ahnv opened this issue Aug 16, 2024 · 0 comments

Comments

@ahnv
Copy link
Member

ahnv commented Aug 16, 2024

Sample Code:

var imagekit = require("imagekit")

let imagekitClient = new imagekit({ publicKey: "does-no-matter", urlEndpoint: "http://ik.imagekit.io/pwliscd3n", privateKey: "aksnda" })

console.log(imagekitClient.url({
    urlEndpoint: "http://ik.imagekit.io/pwliscd3n",
    path: "/Stu's Design/test_YAWJ6NgGN.jpg",
    signed: false,
}))

Expected output
https://ik.imagekit.io/pwliscd3n/Stu's%20Design/test_YAWJ6NgGN.jpg - This URL works

Actual output
https://ik.imagekit.io/pwliscd3n/Stu%27s%20Design/test_YAWJ6NgGN.jpg - This does not work

We use url.format which is a legacy api, we should use the WHATWG URL API
https://nodejs.org/api/url.html#urlformaturlobject

@ahnv ahnv changed the title Incorrect URL being generated for url's containing ' Incorrect URL being generated for url Aug 16, 2024
@ahnv ahnv changed the title Incorrect URL being generated for url Incorrect URL being generated Aug 27, 2024
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

1 participant