Tidwell / node-challonge

A node.js wrapper for the challonge.com API
28 stars 9 forks source link

BUG: An error will occur when player name includes non-Unicode character in `challonge.participants.create` #36

Closed purerosefallen closed 6 years ago

purerosefallen commented 6 years ago

`_http_client.js:105 throw new ERR_UNESCAPED_CHARACTERS('Request path'); ^

TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters at new ClientRequest (_http_client.js:105:13) at Object.request (https.js:272:10) at exports.Participants.Client.makeRequest (/mnt/c/ygo/ygopro-server/node_modules/challonge/lib/api/client.js:106:20) at exports.Participants.Participants.create (/mnt/c/ygo/ygopro-server/node_modules/challonge/lib/api/participants.js:79:7) at UploadToChallonge (/mnt/c/ygo/ygopro-server/ygopro-tournament.js:157:32) at Server. (/mnt/c/ygo/ygopro-server/ygopro-tournament.js:273:20) at Server.emit (events.js:182:13) at parserOnIncoming (_http_server.js:658:12) at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)`

purerosefallen commented 6 years ago

I'm not sure if other functions which asks for player name has the same issue. However, it's very common that name may include non-Unicode character in non-English-speaking countries. I hope this would be solve soon.

Tidwell commented 6 years ago

This should be fixed. All URLS are now being escaped, so this should fix anywhere you want to use extended characters - tournament names, player names, descriptions, etc.

Released to npm as version 2.1.2

Let me know if you run into any issues. Thanks for the report!