You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a service that I don't own and have no control over that uses the statusMessage (also called reason phrases) to communicate information that is critical to take action on.
An example is wget https://example.com in my scenario would return:
HTTP request sent, awaiting response... 503 up
503 is the statusCode
up is the statusMessage
I need to be able to mock this statusMessage with mountebank as the "up" message is necessary to do certain actions on.
Looking into the nodejs http code we can see statusMessage is an optional argument that defaults what we normally see as the message (but it is overridable).
Steps to reproduce
There's no current way to mock the statusMessage
Software versions used
OS :
mountebank :
node.js :
(only if installed via npm)
Installation method :
(npm, zip, tar, pkg, deb, rpm)
mountebank latest
Log contents in mb.log when running mb --loglevel debug
Log contents here
No logs as its not compatible with the code if I'm groking
The text was updated successfully, but these errors were encountered:
Expected behaviour
I was hoping I could add a statusMessage in the response body:
Which in turn in mountebank would essentially do:
Actual behaviour
I have a service that I don't own and have no control over that uses the statusMessage (also called reason phrases) to communicate information that is critical to take action on.
An example is
wget https://example.com
in my scenario would return:503
is the statusCodeup
is the statusMessageI need to be able to mock this statusMessage with mountebank as the "up" message is necessary to do certain actions on.
Mountebank uses writeHead from node
https://github.com/nodejs/node/blob/99f6084ef04dd868c7b894ca0fdbb5088773ca6c/lib/_http_server.js#L341-L365
Here:
mountebank/src/models/http/baseHttpServer.js
Line 143 in 09e2e4a
Looking into the nodejs http code we can see statusMessage is an optional argument that defaults what we normally see as the message (but it is overridable).
Steps to reproduce
There's no current way to mock the statusMessage
Software versions used
mountebank latest
Log contents in mb.log when running mb --loglevel debug
No logs as its not compatible with the code if I'm groking
The text was updated successfully, but these errors were encountered: