Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Issue with two "encodeURIComponent" instead of one #96

Closed
KirianCaumes opened this issue May 22, 2020 · 3 comments
Closed

Issue with two "encodeURIComponent" instead of one #96

KirianCaumes opened this issue May 22, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@KirianCaumes
Copy link
Contributor

Hi,
Just noticed an issue in the last version ("2.8.5") with the method "findItemsByKeywords".
You are calling two times "encodeURIComponent" on the keywords variable :

//findingApi.js l.18
//...
options.keywords = encodeURIComponent(options.keywords);
//...

then

//common-utils/index.js l.22
//...
else if (key === 'keywords' || key === 'categoryId' || key === 'productId' || key === 'sortOrder' || key === 'storeName') {
    const encodeParam = encodeURIComponent(options[key]);
    params = `${params}${key}=${encodeParam}&`;
}
//...

So keywords like "foo bar" would look like "foo%2520bar" instead of "foo%20bar", resulting in a wrong search against Ebay's API.

Noticed that this issue might be present in other piece of codes, but I haven't checked it.

Hope this will help 😉

@pajaydev
Copy link
Owner

@KirianCaumes Thanks for pointing this out. I appreciate it 😄 . Will fix it and release a new version.

@pajaydev pajaydev added the bug Something isn't working label May 23, 2020
@pajaydev
Copy link
Owner

@KirianCaumes I have fixed it. Kindly use this version
npm install ebay-node-api@2.8.6

@KirianCaumes
Copy link
Contributor Author

No problem 😁
It works fine now, thanks !

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants