Open TiFu opened 7 years ago
Hey,
I found an issue with character encoding in urls. E. g. https://euw.api.pvp.net/api/lol/euw/v1.4/summoner/by-name/Scârry?api_key= returns 400 Bad Request, but is valid from the dev portal. This is because request does not encode the url properly. There is an open pull request (https://github.com/request/request/issues/1678) for the request package since May 10.
As a workaround the following code can be inserted before https://github.com/noriah/ashe/blob/master/lib/worker.js#L150
var urlLib = require("url"); var parsedUrl = urlLib.parse(url) // Encode path if needed let parts = urlLib.parse(parsedUrl) if (parts.pathname && parts.host !== 'unix') { // Prevent double encoding parts.pathname = encodeURI(decodeURI(parts.pathname)) parsedUrl = urlLib.format(parts) } url = urlLib.parse(parsedUrl)
Do you want to implement it or should I create a PR?
pull request pls
Hey,
I found an issue with character encoding in urls. E. g. https://euw.api.pvp.net/api/lol/euw/v1.4/summoner/by-name/Scârry?api_key= returns 400 Bad Request, but is valid from the dev portal. This is because request does not encode the url properly. There is an open pull request (https://github.com/request/request/issues/1678) for the request package since May 10.
As a workaround the following code can be inserted before https://github.com/noriah/ashe/blob/master/lib/worker.js#L150
Do you want to implement it or should I create a PR?