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.

Middleware doesn't add any headers

See original GitHub issue

I’ve added CORS_ORIGIN_WHITELIST = ['<some_domain>'], added app to INSTALLED_APPS and added correct middleware to MIDDLEWARE in settings.py and I get NO additional headers that should be generated to fulfill CORS mechanism

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
adamchainzcommented, Sep 27, 2018

@joerick I’d accept a docs PR

0reactions
joerickcommented, Sep 27, 2018

This convo was helpful - after installing corsheaders I wanted to test it was working by doing a curl -v url - it doesn’t show the header in this case.

To test, you can do curl -v -H 'Origin: somedomain.com' http://localhost:8000/api/endpoint. Might be worth a note in the readme? ¯\_(ツ)_/¯

Read more comments on GitHub >

github_iconTop Results From Across the Web

Express middleware not picking up header despite it being ...
Currently, the middleware is not picking up the auth_token header in the request despite it being sent. Any help is appreciated, code below....
Read more >
JS middleware doesn't seem to set headers? - Support
I have a few js middlewares that I'm using in both pre- and post-processing scenarios. I know they're being called, because log messages ......
Read more >
Set header in request (middleware) - Laracasts
Hi, I want to make an api, and by default I want to add the header "Accept: application/json" in a middleware group, this...
Read more >
How to set headers, especially in middleware #11 - GitHub
Regarding adding headers in, the first way to solve it is to just use maps. The ring-http-response library may help if you take...
Read more >
How do you add headers to a response with a middleware
I can't figure out how to how to add headers to a response from a middleware. I've used both ->header(...) and ->headers->set(.
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