Can't access original request headers
See original GitHub issueWhat is the expected behavior? reply callback style should provide access to original request https://github.com/nock/nock#access-original-request-and-headers
What is the actual behavior?
requestBody
is undefined in the callback. this
is an empty object in the callback.
Possible solution I am pretty new to nock so am stumped…
How to reproduce the issue
Runkit: code with test case
Does the bug have a test case? Haven’t found one in nock master. Just in my runkit!
Versions
Software | Version(s) |
---|---|
Nock | 10.0.1 |
Node | 8.4.0 |
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Cannot access headers of the error response
I found out the answer. Reading custom headers is disallowed by the browser due to security reasons. XmlHttpRequest is explicitly stating ...
Read more >Access-Control-Allow-Headers - HTTP - MDN Web Docs
Although CORS-safelisted request headers are always allowed and don't usually need to be listed in Access-Control-Allow-Headers , listing them ...
Read more >Fixing "No 'Access-Control-Allow-Origin' Header Present"
This error occurs when a script on your website/web app attempts to make a request to a resource that isn't configured to accept...
Read more >Adding custom headers to origin requests
These custom headers enable you to send and gather information from your origin that you don't get with typical viewer requests. These headers...
Read more >HttpHeaders (Spring Framework 6.0.3 API)
getFirst(String) returns the first value associated with a given header name ... The CORS Access-Control-Request-Headers request header field name.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
yeah I don’t like relying on
this
either. Definitely something we should get rid ofThanks for the great bug report!
I’d start out by trying to create a failing test that reproduces your problem. Once you have that, start a pull request with the failing test. That would be a great start