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

Search URI encoding #17

Closed
aemixdp opened this issue Sep 14, 2015 · 2 comments
Closed

Search URI encoding #17

aemixdp opened this issue Sep 14, 2015 · 2 comments
Assignees
Labels

Comments

@aemixdp
Copy link

aemixdp commented Sep 14, 2015

Currently database.search uses util.escape and util.addParams (with querystring.stringify inside) to encode a request URI. At least on my PC this results into wrong encoding for which discogs always returns zero results. For example, the query Theory & DanJah Wise - Tribulation gets encoded as /database/search?q=Theory%2520%2526%2520DanJah%2520Wise%2520-%2520Tribulation. When I change it to

client.get({url: "/database/search?q=" + encodeURIComponent(query), authLevel: 1}, callback);

it encodes as /database/search?q=Theory%20%26%20DanJah%20Wise%20-%20Tribulation and everything works fine (discogs returns a result).

@bartve
Copy link
Owner

bartve commented Sep 15, 2015

Woops! Double encoding indeed. Will get this fixed ASAP.

@bartve bartve added the bug label Sep 15, 2015
@bartve bartve self-assigned this Sep 15, 2015
@bartve
Copy link
Owner

bartve commented Sep 15, 2015

Should be fixed in 0.6.7

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

No branches or pull requests

2 participants