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

Please add support for Non-UTF-8 Encoded Request Bodies in HTTP Imposter #775

Open
Ayush-Kaushik opened this issue Sep 25, 2024 · 0 comments

Comments

@Ayush-Kaushik
Copy link

Ayush-Kaushik commented Sep 25, 2024

Expected behaviour

Mountebank HTTP Imposter should support request bodies in encoding other than the default UTF-8. This would ensure that special characters outside the UTF-8 character set (such as certain extended ASCII characters or specific binary data) can be sent and received without being mangled.

Actual behaviour

When sending requests with bodies in an encoding other than UTF-8, Mountebank records the request, but the body is mangled if the encoding contains special characters unsupported by UTF-8. This limitation results in loss or corruption of data, making it impossible to handle certain types of encoded requests accurately.

Steps to reproduce

  1. Set up an HTTP imposter in Mountebank.
  2. Send an HTTP request with a body containing special characters or data encoded in a format other than UTF-8 (e.g., binary data).
  3. Observe that the request body in the recorded request is corrupted or mangled (cannot be safely converted back into format it was sent in)

Software versions used

OS         : Windows 10
mountebank : latest mountebank docker image
node.js    : not applicable since I am using docker container based mountebank
  (only if installed via npm)
Installation method :
  (npm, zip, tar, pkg, deb, rpm)

Log contents in mb.log when running mb --loglevel debug

Not applicable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant