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.

HTTP_ORIGIN is empty so origin is False all the time

See original GitHub issue

Whatever I do, request.META.get(‘HTTP_ORIGIN’) return None

I changed it for

origin = request.get_host()

and that made it work

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
adamchainzcommented, Apr 6, 2018

Origin is sent by your browser on cross-origin requests only: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin .

0reactions
andrscyvcommented, Jan 17, 2021

Hi! I have this problem on Django 2.2.3 while running both the back end and the front end in localhost, si there any workaround to make it work ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP_ORIGIN is empty so origin is False all the time #56
I have this problem when I am running locally using runserver (the django dev server). Same fix worked. What's the prognosis for an ......
Read more >
How secure is HTTP_ORIGIN? - php - Stack Overflow
Its name in the request header is Origin . On the server in my PHP script I see it as HTTP_ORIGIN in the...
Read more >
Fixing "No 'Access-Control-Allow-Origin' Header Present"
"No 'access-control-allow-origin' header present" is one of the least helpful error messages. So, what is it and why is it breaking your web ......
Read more >
Cross-Origin Resource Sharing (CORS) Policy
originGroups.origins. Optional. Empty array. List of origins to be included in the group. For example, http://www.the-origin-of-time.com ; originGroups.origins.
Read more >
Request and response behavior for custom origins
If you configure CloudFront to accept and forward to your origin all of the ... so the next time it receives a request...
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