-
-
Notifications
You must be signed in to change notification settings - Fork 536
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
"Protocol "http:" not supported. Expected "https:"" when using superagent #632
Comments
Hey, @tomdohnal. Thanks for reporting this. Once again we're dealing with million ways of creating a request in Node.js. I suspect that the request params of If you're comfortable with debugging, you can clone Huge thanks for preparing a test repo! I will try to look into it. |
OK so I did some debugging and found out that the problem is caused by the fact that when As per https://nodejs.org/api/https.html#https_https_request_options_callback the default value of the However, as the One possible solution that comes to my mind would be to propagate the I'm happy to send a PR with the fix but first I wanted to discuss how to approach this 🙂 |
Hey, @tomdohnal. Thank you for the investigation! You're right, as there's a way to create a |
Thanks a lot for the fix @kettanaito ! |
Just got bit by this one. Excited to try out the fix though, any ideas when it may get published? |
This should get published in the next version (#660). |
Released in |
Describe the bug
When I try to use
msw
alongsidesuperagent
in Node, it throws an error:(I'm aware of issues such as #209 but this one seems to be different)
Environment
msw: 0.27.0
nodejs: 12.14.0
npm: 0.0.0
To Reproduce
Clone the repository on https://github.com/tomdohnal/msw-superagent-repro or run this piece of code using
node
Expected behavior
No error should be thrown and the call should be mocked
Screenshots
n/a
The text was updated successfully, but these errors were encountered: