mountebank icon indicating copy to clipboard operation
mountebank copied to clipboard

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

Open Ayush-Kaushik opened this issue 1 year ago • 1 comments

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

Ayush-Kaushik avatar Sep 25 '24 03:09 Ayush-Kaushik

Maybe duplicate of #576

jarl-dk avatar Jun 18 '25 11:06 jarl-dk