question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't access original request headers

See original GitHub issue

What 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:closed
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
gr2mcommented, Jan 10, 2019

yeah I don’t like relying on this either. Definitely something we should get rid of

1reaction
gr2mcommented, Oct 12, 2018

Thanks 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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found