Skip to content

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

@Ayush-Kaushik

Description

@Ayush-Kaushik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions