-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
Status code is ignored when response payload is empty #1170
Comments
Could you please create a runkit notebook such as https://runkit.com/gr2m/node-nock-nock-768 to reproduce the problem? |
@gr2m https://repl.it/@StarpTech/TestCase-1170 if you add a string to the array |
That looks like the desired behaviour to me. It may just be that you need to send a body, or it will default to 200. Is this an inconvenience? This is set in Interceptor.prototype.reply = function reply(statusCode, body, rawHeaders) {
if (arguments.length <= 2 && _.isFunction(statusCode)) {
body = statusCode;
statusCode = 200;
}
... |
Of course! When I send 401 I expect 401. |
Ok. Someone needs to take a look at the interceptor logic, then. I am at a loss as to how to do this easily. For now, pass in an empty body in a string. |
@RichardLitt I provide a fix #1203 |
🎉 This issue has been resolved in version 10.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it’s related. Thank you! |
This will return the statusCode
200
but I expect401
. This can be fixed when I pass an empty response body like[401, '']
. It this the desired bahviour?The text was updated successfully, but these errors were encountered: