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
What is the expected behavior?
Nock should match a request independent from an existing proxy configuration.
What is the actual behavior?
When HTTP_PROXY or HTTPS_PROXY is set, the incoming url consists of the proxy and the actual url, resulting in a missing match.
Possible solution
How to reproduce the issue
Have a proxy defined via environment variables (HTTP_PROXY resp. HTTPS_PROXY), Nock will no longer match the request since the incoming url will consist of both the proxy url and the actual url. Run the example below locally with a value set vor HTTP_PROXY.
Having problem producing a test case? Try and ask the community for help. If the test case cannot be reproduced, the Nock community might not be able to help you.
Does the bug have a test case?
Versions
Software
Version(s)
Nock
13.0.5
Node
14.8.0
TypeScript
The text was updated successfully, but these errors were encountered:
It's important to note that Node itself does not modify requests based on HTTP_PROXY/HTTPS_PROXY. You're probably using a client that's doing it, your runkit uses Axios for example, which does follow the env vars.
Nock can still match these requests, it's just that you have to modify the scope to match how the client is modifying the request (NB. how those env vars are used is not standardized, it's just a widely used convention).
The preference with Nock is to stay as close to native Node as possible. Implementing it in Nock before it's part of core Node would more than likely come with a slew of gotchas and caveats.
Personally, I would prefer to not add this unless there was a much larger demand for the feature.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We try to do our best, but nock is maintained by volunteers and there is only so much we can do at a time. Thank you for your contributions.
What is the expected behavior?
Nock should match a request independent from an existing proxy configuration.
What is the actual behavior?
When HTTP_PROXY or HTTPS_PROXY is set, the incoming url consists of the proxy and the actual url, resulting in a missing match.
Possible solution
How to reproduce the issue
Have a proxy defined via environment variables (HTTP_PROXY resp. HTTPS_PROXY), Nock will no longer match the request since the incoming url will consist of both the proxy url and the actual url. Run the example below locally with a value set vor HTTP_PROXY.
Runkit: Example link
Having problem producing a test case? Try and ask the community for help. If the test case cannot be reproduced, the Nock community might not be able to help you.
Does the bug have a test case?
Versions
The text was updated successfully, but these errors were encountered: