Code Monkey home page Code Monkey logo

Comments (6)

ssaavedra avatar ssaavedra commented on August 19, 2024

That is already documented. In settings.py you set CORS_ALLOW_HEADERS to whichever iterable you like.

from django-cors-headers.

eskhool avatar eskhool commented on August 19, 2024

Well although this is works, but the default doesn't seem to include popular cases such as DNT? I have DNT setup by default so it tripped up CORS. If the default does not include that to make the developer add it explicitly then:

  1. we should document that
  2. can we separate the default_headers tuple from the defaults.py file so it can be imported and then extended so as to avoid entering all the default headers on top? Or some other mechanism to do both default and custom headers?

from django-cors-headers.

gustavi avatar gustavi commented on August 19, 2024

Because of inactivity of the project and no answer of the author our team decide to fork it. Please create an issue if this is always required.

from django-cors-headers.

adamchainz avatar adamchainz commented on August 19, 2024

Both @eskhool's second suggestion (would need to make default_headers a list to be mutable), plus adding DNT to default_headers by default, sound like good ideas.

from django-cors-headers.

adamchainz avatar adamchainz commented on August 19, 2024

Since the #127 dynamic settings refactor it is now possible to import default_headers and default_methods from corsheaders.defaults and use them in your own settings. This is now documented in the README and is available on PyPI as version 1.2.1.

I don't know about adding DNT to the defaults, I'm unsure whether there are any security implications. Will research it a bit more.

from django-cors-headers.

adamchainz avatar adamchainz commented on August 19, 2024

Made #138 to track the final step adding DNT.

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.