Skip to content

Commit

Permalink
chore: add cors regex setting (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoesbergen authored Dec 24, 2024
1 parent 779ba67 commit 334744c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Settings(BaseSettings):

arduino_cli_path: str = "arduino-cli"
cors_origins: list[str] = ["*"]
cors_origin_regex: str | None = None
log_level: str = "INFO"

# Session settings
Expand Down
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
app.add_middleware(
CORSMiddleware,
allow_origins=settings.cors_origins,
allow_origin_regex=settings.cors_origin_regex,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
Expand Down

0 comments on commit 334744c

Please sign in to comment.