Skip to content

Commit

Permalink
Added comment to clarify why we are using internals from Flask-CORS t…
Browse files Browse the repository at this point in the history
…o check for regex
  • Loading branch information
bartvanb committed Mar 6, 2024
1 parent a67760a commit 1bf1603
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vantage6-server/vantage6/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ def _warn_if_cors_regex(origins: str | list[str]) -> None:
properly for socket events (Flask-SocketIO checks for string equality and does
not use regex).
Note that we are using the `probably_regex` function from Flask-CORS to check
if the origins are probably regular expressions - the Flask implementation for
determining if it is a regex is a bit hacky (see
https://github.com/corydolphin/flask-cors/blob/3.0.10/flask_cors/core.py#L275-L285)
and Flask-CORS doesn't currently offer an opt out of regex's altogether.
Parameters
----------
origins: str | list[str]
Expand Down

0 comments on commit 1bf1603

Please sign in to comment.