Skip to content

Commit

Permalink
feat: remove CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
Yazawazi committed Oct 9, 2023
1 parent bad790c commit 87f3be2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
13 changes: 11 additions & 2 deletions backend/funix/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@
from secrets import token_hex

import flask
from flask_cors import CORS

app = flask.Flask(__name__)
app.secret_key = token_hex(16)
CORS(app)
app.config.update(
SESSION_COOKIE_PATH="/",
SESSION_COOKIE_SAMESITE="Lax",
)


@app.after_request
def funix_auto_cors(response: flask.Response) -> flask.Response:
response.headers["Access-Control-Allow-Origin"] = "*"
response.headers["Access-Control-Allow-Methods"] = "GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE"
return response
7 changes: 0 additions & 7 deletions backend/funix/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
flask>=2.2.2
flask_cors>=3.0.10
functions-framework==3.*
requests>=2.28.1
matplotlib>=3.6.1
mpld3>=0.5.8
plac>=1.3.5
GitPython>=3.1.31
IPython>=8.14.0
ipywidgets>=8.0.7
pandera>=0.17.2
pandas>=2.0.3
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ classifiers = [
]
dependencies = [
"flask>=2.2.2",
"flask_cors>=3.0.10",
"functions-framework==3.*",
"requests>=2.28.1",
"plac>=1.3.5"
Expand Down

0 comments on commit 87f3be2

Please sign in to comment.