Code Monkey home page Code Monkey logo

Comments (3)

5amfung avatar 5amfung commented on August 19, 2024

Not working for me neither. CORS_ORIGIN_ALLOW_ALL is set to True but the header I got back is the following. I don't see Access-Control-Allow-Origin in the header at all.

$ http --headers 'http://localhost:8000/api/post/?lat=37.7019713&lng=-122.420255' 
HTTP/1.0 200 OK
Allow: GET, HEAD, OPTIONS
Content-Encoding: gzip
Content-Length: 2818
Content-Type: application/json
Date: Sat, 29 Aug 2015 22:01:49 GMT
Server: WSGIServer/0.2 CPython/3.4.3
Vary: Accept, Accept-Encoding, Cookie
X-Frame-Options: SAMEORIGIN

from django-cors-headers.

5amfung avatar 5amfung commented on August 19, 2024

Looks like httpie doesn't automatically include Origin in the http request header. When there's no Origin, Access-Control-Allow-Origin is not returned in the response header. @s2krish you might want to check your request header to see if Origin is there.

from django-cors-headers.

s2krish avatar s2krish commented on August 19, 2024

Seems it works. It adds the header dynamically. For instance I setup a virtualhost in my local with name if cors-headr-test.lan. I made ajax request to http://127.0.0.0.1:800/my/api from http:// cors-headr-test.lan/, it has added cors header.

Access-Control-Allow-Credentials:true
Access-Control-Allow-Origin:ttp:// cors-headr-test.lan

So closing this.

from django-cors-headers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.