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.

Avoid failing on headers conflict

See original GitHub issue

The folowing error happen when a header has been set by the client library twice (one time in uppercase and another time in lower case. Failed to convert header keys to lower case due to field name conflict: {headerName}.

It is certainly a bad practice to do so but the fact is that nock is used mostly to mock external libraries calls so it would be useful to be able to disable error throwing for such cases with some options.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
tedehcommented, Feb 12, 2018

Why hasn’t this been merged yet? It would appear to be a mostly harmless PR. Last given option should override earlier ones, like every other node library around.

2reactions
dcstone09commented, Apr 18, 2017

@CFreeAtEbsco I just updated the test, everything looks good to me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to handle header name conflict with standerd library ...
3. The correct way to exclude local headers is to #include <...> · But the case is that library header includes wrong file....
Read more >
Top 10 C++ header file mistakes and how to fix them
Mistake # 1: Not using “include guards” in a header file. ... You usually name your #include guard the same as the name...
Read more >
c++ - How can I prevent header hell?
Clean up the includes after each refactoring (comment them out, see where compilation fails, move them there, remove the still commented include ...
Read more >
Once-Only Headers (The C Preprocessor)
If a header file happens to be included twice, the compiler will process its contents twice. This is very likely to cause an...
Read more >
CORS errors - HTTP - MDN Web Docs - Mozilla
If the CORS configuration isn't setup correctly, the browser console will present an error like "Cross-Origin Request Blocked: The Same ...
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