summaryrefslogtreecommitdiffhomepage
path: root/libs/werkzeug
diff options
context:
space:
mode:
authorMoravčík, Marian <[email protected]>2021-02-14 10:30:30 +0100
committerMoravčík, Marian <[email protected]>2021-02-14 10:30:30 +0100
commita876f8ca00b2596e11a9eb25f906afeac5bdf23a (patch)
treebbd67d1038feba1ba6ebd370683197111a8ba468 /libs/werkzeug
parentbee05bd8edd826be4a6169f9c6a39ce05dcecb46 (diff)
downloadbazarr-a876f8ca00b2596e11a9eb25f906afeac5bdf23a.tar.gz
bazarr-a876f8ca00b2596e11a9eb25f906afeac5bdf23a.zip
Revert "Fix missing Datatables source, and update Datatables plugins"
This reverts commit bee05bd8
Diffstat (limited to 'libs/werkzeug')
-rw-r--r--libs/werkzeug/wrappers/cors.py100
1 files changed, 0 insertions, 100 deletions
diff --git a/libs/werkzeug/wrappers/cors.py b/libs/werkzeug/wrappers/cors.py
deleted file mode 100644
index 502fcf17f..000000000
--- a/libs/werkzeug/wrappers/cors.py
+++ /dev/null
@@ -1,100 +0,0 @@
-from ..http import dump_header
-from ..http import parse_set_header
-from ..utils import environ_property
-from ..utils import header_property
-
-
-class CORSRequestMixin(object):
- """A mixin for :class:`~werkzeug.wrappers.BaseRequest` subclasses
- that adds descriptors for Cross Origin Resource Sharing (CORS)
- headers.
-
- .. versionadded:: 1.0
- """
-
- origin = environ_property(
- "HTTP_ORIGIN",
- doc=(
- "The host that the request originated from. Set"
- " :attr:`~CORSResponseMixin.access_control_allow_origin` on"
- " the response to indicate which origins are allowed."
- ),
- )
-
- access_control_request_headers = environ_property(
- "HTTP_ACCESS_CONTROL_REQUEST_HEADERS",
- load_func=parse_set_header,
- doc=(
- "Sent with a preflight request to indicate which headers"
- " will be sent with the cross origin request. Set"
- " :attr:`~CORSResponseMixin.access_control_allow_headers`"
- " on the response to indicate which headers are allowed."
- ),
- )
-
- access_control_request_method = environ_property(
- "HTTP_ACCESS_CONTROL_REQUEST_METHOD",
- doc=(
- "Sent with a preflight request to indicate which method"
- " will be used for the cross origin request. Set"
- " :attr:`~CORSResponseMixin.access_control_allow_methods`"
- " on the response to indicate which methods are allowed."
- ),
- )
-
-
-class CORSResponseMixin(object):
- """A mixin for :class:`~werkzeug.wrappers.BaseResponse` subclasses
- that adds descriptors for Cross Origin Resource Sharing (CORS)
- headers.
-
- .. versionadded:: 1.0
- """
-
- @property
- def access_control_allow_credentials(self):
- """Whether credentials can be shared by the browser to
- JavaScript code. As part of the preflight request it indicates
- whether credentials can be used on the cross origin request.
- """
- return "Access-Control-Allow-Credentials" in self.headers
-
- @access_control_allow_credentials.setter
- def access_control_allow_credentials(self, value):
- if value is True:
- self.headers["Access-Control-Allow-Credentials"] = "true"
- else:
- self.headers.pop("Access-Control-Allow-Credentials", None)
-
- access_control_allow_headers = header_property(
- "Access-Control-Allow-Headers",
- load_func=parse_set_header,
- dump_func=dump_header,
- doc="Which headers can be sent with the cross origin request.",
- )
-
- access_control_allow_methods = header_property(
- "Access-Control-Allow-Methods",
- load_func=parse_set_header,
- dump_func=dump_header,
- doc="Which methods can be used for the cross origin request.",
- )
-
- access_control_allow_origin = header_property(
- "Access-Control-Allow-Origin",
- doc="The origin or '*' for any origin that may make cross origin requests.",
- )
-
- access_control_expose_headers = header_property(
- "Access-Control-Expose-Headers",
- load_func=parse_set_header,
- dump_func=dump_header,
- doc="Which headers can be shared by the browser to JavaScript code.",
- )
-
- access_control_max_age = header_property(
- "Access-Control-Max-Age",
- load_func=int,
- dump_func=str,
- doc="The maximum age in seconds the access control settings can be cached for.",
- )