You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,10 @@ Flask-CORS
6
6
7
7
A Flask extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible.
8
8
9
-
This package has a simple philosophy: when you want to enable CORS, you wish to enable it for all use cases on a domain.
10
-
This means no mucking around with different allowed headers, methods, etc.
9
+
This package has a simple philosophy: when you want to enable CORS, you wish to enable it for all use cases on a domain.
10
+
This means no mucking around with different allowed headers, methods, etc.
11
11
12
-
By default, submission of cookies across domains is disabled due to the security implications.
12
+
By default, submission of cookies across domains is disabled due to the security implications.
13
13
Please see the documentation for how to enable credential'ed requests, and please make sure you add some sort of `CSRF <http://en.wikipedia.org/wiki/Cross-site_request_forgery>`__ protection before doing so!
14
14
15
15
Installation
@@ -24,14 +24,14 @@ Install the extension with using pip, or easy\_install.
24
24
Usage
25
25
-----
26
26
27
-
This package exposes a Flask extension which by default enables CORS support on all routes, for all origins and methods.
28
-
It allows parameterization of all CORS headers on a per-resource level.
27
+
This package exposes a Flask extension which by default enables CORS support on all routes, for all origins and methods.
28
+
It allows parameterization of all CORS headers on a per-resource level.
29
29
The package also contains a decorator, for those who prefer this approach.
30
30
31
31
Simple Usage
32
32
~~~~~~~~~~~~
33
33
34
-
In the simplest case, initialize the Flask-Cors extension with default arguments in order to allow CORS for all domains on all routes.
34
+
In the simplest case, initialize the Flask-Cors extension with default arguments in order to allow CORS for all domains on all routes.
35
35
See the full list of options in the `documentation <https://flask-cors.corydolphin.com/en/latest/api.html#extension>`__.
36
36
37
37
.. code:: python
@@ -50,7 +50,7 @@ See the full list of options in the `documentation <https://flask-cors.corydolph
50
50
Resource specific CORS
51
51
^^^^^^^^^^^^^^^^^^^^^^
52
52
53
-
Alternatively, you can specify CORS options on a resource and origin level of granularity by passing a dictionary as the `resources` option, mapping paths to a set of options.
53
+
Alternatively, you can specify CORS options on a resource and origin level of granularity by passing a dictionary as the `resources` option, mapping paths to a set of options.
54
54
See the full list of options in the `documentation <https://flask-cors.corydolphin.com/en/latest/api.html#extension>`__.
55
55
56
56
.. code:: python
@@ -65,8 +65,8 @@ See the full list of options in the `documentation <https://flask-cors.corydolph
65
65
Route specific CORS via decorator
66
66
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67
67
68
-
This extension also exposes a simple decorator to decorate flask routes with.
69
-
Simply add ``@cross_origin()`` below a call to Flask's ``@app.route(..)`` to allow CORS on a given route.
68
+
This extension also exposes a simple decorator to decorate flask routes with.
69
+
Simply add ``@cross_origin()`` below a call to Flask's ``@app.route(..)`` to allow CORS on a given route.
70
70
See the full list of options in the `decorator documentation <https://flask-cors.corydolphin.com/en/latest/api.html#decorator>`__.
71
71
72
72
.. code:: python
@@ -94,7 +94,7 @@ If things aren't working as you expect, enable logging to help understand what i
94
94
Tests
95
95
-----
96
96
97
-
A simple set of tests is included in ``test/``.
97
+
A simple set of tests is included in ``test/``.
98
98
To run, install nose, and simply invoke ``nosetests`` or ``python setup.py test`` to exercise the tests.
99
99
100
100
If nosetests does not work for you, due to it no longer working with newer python versions.
@@ -103,16 +103,16 @@ You can use pytest to run the tests instead.
103
103
Contributing
104
104
------------
105
105
106
-
Questions, comments or improvements?
107
-
Please create an issue on `Github <https://github.com/corydolphin/flask-cors>`__, tweet at `@corydolphin <https://twitter.com/corydolphin>`__ or send me an email.
106
+
Questions, comments or improvements?
107
+
Please create an issue on `Github <https://github.com/corydolphin/flask-cors>`__, tweet at `@corydolphin <https://twitter.com/corydolphin>`__ or send me an email.
108
108
I do my best to include every contribution proposed in any way that I can.
109
109
110
110
Credits
111
111
-------
112
112
113
113
This Flask extension is based upon the `Decorator for the HTTP Access Control <https://web.archive.org/web/20190128010149/http://flask.pocoo.org/snippets/56/>`__ written by Armin Ronacher.
0 commit comments