Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/corydolphin/flask-cors
/ functions
Functions
219 in github.com/corydolphin/flask-cors
⨍
Functions
219
◇
Types & classes
30
↳
Endpoints
71
↓ 122 callers
Method
get
(self, *args, **kwargs)
tests/base_test.py:49
↓ 45 callers
Method
iter_responses
(self, path, verbs=['get', 'head', 'options'], **kwargs)
tests/base_test.py:36
↓ 12 callers
Method
preflight
(self, path, method='GET', cors_request_headers=None, json=True, **kwargs)
tests/base_test.py:70
↓ 8 callers
Method
_request
(self, verb, *args, **kwargs)
tests/base_test.py:40
↓ 8 callers
Function
probably_regex
(maybe_regex: ResourcePattern)
flask_cors/core.py:389
↓ 7 callers
Function
get_allow_headers
(options: _ComputedCorsOptions, acl_request_headers: str | None)
flask_cors/core.py:280
↓ 7 callers
Method
options
(self, *args, **kwargs)
tests/base_test.py:58
↓ 7 callers
Function
try_match_pattern
Match a value against a *resolved* pattern: a compiled ``re.Pattern`` (whose case-sensitivity is already baked in) or a literal string. Used
flask_cors/core.py:410
↓ 6 callers
Function
serialize_options
Normalize a raw options mapping into a strongly-typed :class:`_ComputedCorsOptions`. This is the single boundary where loosely-typed user in
flask_cors/core.py:511
↓ 5 callers
Function
re_fix
Replace the invalid regex r'*' with the valid, wildcard regex r'/.*' to enable the CORS app extension to have a more user friendly api.
flask_cors/core.py:398
↓ 4 callers
Function
flexible_str
A more flexible str function which intelligently handles stringifying strings, lists and other iterables. The results are lexographically sor
flask_cors/core.py:456
↓ 4 callers
Method
init_app
(self, app: Flask | Blueprint, **kwargs: Unpack[CorsOptionsInput])
flask_cors/extension.py:168
↓ 2 callers
Function
_resolve_pattern
Resolve a single raw pattern once, at configuration time. A regex-like string is compiled to a ``re.Pattern`` (with the correct case-sensitiv
flask_cors/core.py:485
↓ 2 callers
Function
_resolve_patterns
Resolve a list of patterns (see :func:`_resolve_pattern`). After this, the request path can simply test ``isinstance(p, re.Pattern)`` instead
flask_cors/core.py:502
↓ 2 callers
Function
add_routes
(app)
tests/decorator/test_exception_interception.py:21
↓ 2 callers
Function
get_cors_options
Compute the resolved CORS options for an application (see merge_options).
flask_cors/core.py:441
↓ 2 callers
Function
get_regexp_pattern
Helper that returns regexp pattern from given value. :param regexp: regular expression to stringify :type regexp: re.Pattern or str
flask_cors/core.py:213
↓ 2 callers
Method
head
(self, *args, **kwargs)
tests/base_test.py:52
↓ 2 callers
Function
merge_options
Merge the DEFAULT_OPTIONS, the app's configuration-specified options and any dictionaries passed into a single raw options mapping. The last
flask_cors/core.py:428
↓ 2 callers
Function
parse_resources
(resources: ResourceSpec)
flask_cors/core.py:173
↓ 2 callers
Function
sanitize_regex_param
(param: Any)
flask_cors/core.py:481
↓ 2 callers
Function
set_cors_headers
Performs the actual evaluation of Flask-CORS options and actually modifies the response object. This function is used both in the decora
flask_cors/core.py:357
↓ 2 callers
Function
try_match_any_pattern
(inst: str, patterns: Iterable[ResourcePattern], caseSensitive: bool = True)
flask_cors/core.py:406
↓ 1 callers
Method
assertHasACLOrigin
(self, resp, origin=None)
tests/base_test.py:82
↓ 1 callers
Function
cors_after_request
(resp: Response)
flask_cors/extension.py:217
↓ 1 callers
Function
ensure_iterable
Wraps scalars or string types as a list, or returns the iterable instance.
flask_cors/core.py:471
↓ 1 callers
Function
get_app_kwarg_dict
Returns the dictionary of CORS specific app configurations.
flask_cors/core.py:446
↓ 1 callers
Function
get_cors_headers
( options: _ComputedCorsOptions, request_headers: Headers, request_method: str )
flask_cors/core.py:296
↓ 1 callers
Function
get_cors_origins
(options: _ComputedCorsOptions, request_origin: str | None)
flask_cors/core.py:227
↓ 1 callers
Function
make_after_request_function
( resources: list[tuple[ResourcePattern, _ComputedCorsOptions]], )
flask_cors/extension.py:214
Method
__init__
(self, app: Flask | Blueprint | None = None, **kwargs: Unpack[CorsOptionsInput])
flask_cors/extension.py:163
Method
_after_request_decorator
(f: Callable[..., Any])
flask_cors/extension.py:204
Method
allowOrigins
This sets up flask-cors to echo the request's `Origin` header, only if it is actually set. This behavior is most similar to
tests/decorator/test_w3.py:24
Method
catch_all_handler
This error handler catches 404s and 500s and returns status 200 no matter what. It is not a good handler.
tests/decorator/test_exception_interception.py:126
Method
catch_all_handler
This error handler catches 404s and 500s and returns status 200 no matter what. It is not a good handler.
tests/decorator/test_exception_interception.py:177
Function
create_user
Since the path matches the regular expression r'/api/*', this resource automatically has CORS headers set. Browsers will fir
examples/blueprints_based_example.py:57
Function
create_user
Since the path matches the regular expression r'/api/*', this resource automatically has CORS headers set. Browsers will fir
examples/app_based_example.py:81
Function
cross_origin
This function is the decorator which is used to wrap a Flask route with. In the simplest case, simply use the default parameters to allow all
flask_cors/decorator.py:20
Function
cross_origin_json_post
This view has CORS enabled for all domains, and allows browsers to send the Content-Type header, allowing cross domain AJAX POST
examples/view_based_example.py:62
Function
decorator
(f: F)
flask_cors/decorator.py:108
Method
defaults
()
tests/decorator/test_methods.py:25
Method
defaults
()
tests/decorator/test_max_age.py:25
Method
delete
(self, *args, **kwargs)
tests/base_test.py:67
Method
example
()
tests/extension/test_app_extension.py:350
Method
exposed1
()
tests/extension/test_app_extension.py:180
Method
exposed1
()
tests/extension/test_app_extension.py:212
Method
exposed2
()
tests/extension/test_app_extension.py:184
Method
exposed2
()
tests/extension/test_app_extension.py:216
Method
foo_txt
()
tests/extension/test_app_extension.py:229
Function
get_exception
Since the path matches the regular expression r'/api/*', this resource automatically has CORS headers set. Browsers will fir
examples/app_based_example.py:124
Method
get_with_origins
(path)
tests/decorator/test_exception_interception.py:144
Method
get_with_origins
(path)
tests/decorator/test_exception_interception.py:194
Function
helloWorld
This view has CORS enabled for all domains, representing the simplest configuration of view-based decoration. The expected result is
examples/view_based_example.py:34
Function
helloWorld
Since the path '/' does not match the regular expression r'/api/*', this route does not have CORS headers set.
examples/blueprints_based_example.py:102
Function
helloWorld
Since the path '/' does not match the regular expression r'/api/*', this route does not have CORS headers set.
examples/app_based_example.py:41
Method
index
()
tests/core/test_override_headers.py:21
Method
index
()
tests/extension/test_app_extension.py:225
Method
index
()
tests/extension/test_app_extension.py:280
Method
index
()
tests/extension/test_app_extension.py:296
Method
index
()
tests/extension/test_app_extension.py:346
Method
index
()
tests/extension/test_app_extension.py:371
Method
iter_verbs
A simple helper method to iterate through a range of HTTP Verbs and return the test_client bound instance, keeping writing ou
tests/base_test.py:28
Function
list_users
Since the path matches the regular expression r'/api/*', this resource automatically has CORS headers set. The expected result is as
examples/blueprints_based_example.py:33
Function
list_users
Since the path matches the regular expression r'/api/*', this resource automatically has CORS headers set. The expected result is as
examples/app_based_example.py:57
Method
noWildcard
With the default origins configuration, send_wildcard should still be respected.
tests/decorator/test_w3.py:35
Method
no_cors
()
tests/extension/test_blueprint.py:31
Method
overridden
()
tests/extension/test_app_extension.py:221
Method
patch
(self, *args, **kwargs)
tests/base_test.py:64
Method
ping
()
tests/extension/test_blueprint.py:27
Method
ping_v2
()
tests/extension/test_blueprint.py:56
Method
plus_path
()
tests/extension/test_app_extension.py:392
Method
post
(self, *args, **kwargs)
tests/base_test.py:55
Method
put
(self, *args, **kwargs)
tests/base_test.py:61
Method
send_wildcard_with_origin
()
tests/extension/test_app_extension.py:53
Function
server_error
(e: Exception)
examples/app_based_example.py:149
Method
setUp
(self)
tests/decorator/test_duplicate_headers.py:17
Method
setUp
(self)
tests/decorator/test_allow_headers.py:16
Method
setUp
(self)
tests/decorator/test_vary_header.py:20
Method
setUp
(self)
tests/decorator/test_expose_headers.py:17
Method
setUp
(self)
tests/decorator/test_credentials.py:20
Method
setUp
(self)
tests/decorator/test_methods.py:20
Method
setUp
(self)
tests/decorator/test_w3.py:19
Method
setUp
(self)
tests/decorator/test_options.py:20
Method
setUp
(self)
tests/decorator/test_private_network_headers.py:11
Method
setUp
(self)
tests/decorator/test_exception_interception.py:42
Method
setUp
(self)
tests/decorator/test_exception_interception.py:158
Method
setUp
(self)
tests/decorator/test_max_age.py:20
Method
setUp
(self)
tests/decorator/test_origins.py:21
Method
setUp
(self)
tests/core/test_override_headers.py:16
Method
setUp
(self)
tests/extension/test_app_extension.py:22
Method
setUp
(self)
tests/extension/test_app_extension.py:170
Method
setUp
(self)
tests/extension/test_app_extension.py:204
Method
setUp
(self)
tests/extension/test_app_extension.py:289
Method
setUp
(self)
tests/extension/test_app_extension.py:384
Method
setUp
(self)
tests/extension/test_blueprint.py:22
Method
shortDescription
Get's the one liner description to be displayed. Source: http://erikzaadi.com/2012/09/13/inheritance-within-python-unit-tests
tests/base_test.py:19
Function
sort_key
(pair: tuple[ResourcePattern, Any])
flask_cors/core.py:180
Method
space_path
()
tests/extension/test_app_extension.py:396
Function
supports_blueprint
()
tests/typecheck/test_blueprint_typing.py:25
Function
supports_flask_app
()
tests/typecheck/test_blueprint_typing.py:19
next →
1–100 of 219, ranked by callers