Skip to content

Commit 0ec4ee3

Browse files
committed
fix(CORS): update CLI
1 parent 0890584 commit 0ec4ee3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/opengeodeweb_back/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def run_server(app: Flask) -> None:
132132
parser.add_argument(
133133
"-origins",
134134
"--allowed_origins",
135+
nargs="+",
135136
default=app.config.get("ORIGINS"),
136137
help="Origins that are allowed to connect to the server",
137138
)
@@ -148,7 +149,8 @@ def run_server(app: Flask) -> None:
148149
)
149150
app.config.update(UPLOAD_FOLDER=args.upload_folder_path)
150151
app.config.update(MINUTES_BEFORE_TIMEOUT=args.timeout)
151-
flask_cors.CORS(app, origins=args.allowed_origins)
152+
origins = args.allowed_origins.split(",")
153+
flask_cors.CORS(app, origins=origins)
152154
print(f"{args=}", flush=True)
153155

154156
db_filename: str = app.config.get("DATABASE_FILENAME") or "project.db"

0 commit comments

Comments
 (0)