BottleneckStudio / messenger-game

An HTML5 game using Phaser or some library.
0 stars 0 forks source link

HTTP module should use encodeURIComponent instead of escape #7

Closed void-ecs closed 5 years ago

void-ecs commented 5 years ago

When posting plain object, pc.Http.request encodes both keys and values with escape. They should be encoded with encodeURIComponent instead.

For example: escape('你好') results in '%u4F60%u597D' while encodeURIComponent('你好') produces '%E4%BD%A0%E5%A5%BD' and the correct value to send is '%E4%BD%A0%E5%A5%BD'.

void-ecs commented 5 years ago

Sorry, I posted this in the wrong repository