colyseus / uWebSockets-express

Express API compatibility layer for uWebSockets.js
https://npmjs.com/package/uwebsockets-express
MIT License
56 stars 13 forks source link

uWebSockets-express should stop utf-8 decoding the body #33

Closed Brahmah closed 7 months ago

Brahmah commented 9 months ago

https://github.com/expressjs/body-parser/issues/494#issuecomment-1837465665

endel commented 9 months ago

Thanks for the heads-up @Brahmah, would you like to send a PR for this?

Brahmah commented 9 months ago

@endel Happy to when I get a chance, but just got to do a little more testing to ensure it doesn't break anything else...

hunkydoryrepair commented 7 months ago

What is status of this? We just encounted failure on all of our endpoints when multibyte-characters are sent. Is there an older version uWebSockets that works?

We get errors in raw-body of express Request size did not match length or something to that effect, because the _rawbody is made into a string so the .length is not the actually length in bytes, but length in characters.

if there is not a fix, I think we need to roll back to a working version.

hunkydoryrepair commented 7 months ago

https://github.com/colyseus/uWebSockets-express/pull/34

endel commented 7 months ago

Thanks for the PR @hunkydoryrepair. 🙏

Hi @Brahmah, could you confirm if new version 1.3.6 fixes the issue you were having too, or if you were experiencing something else?

Cheers

Brahmah commented 7 months ago

Hi @endel

I've just checked out the PR and it's identical to what I ended up doing internally so should fix the multi byte character issue we discussed in the comments.

Thanks for taking the initiative @hunkydoryrepair and apologies for leaving this stale.