Skip to content

Commit

Permalink
localhostと扱うURLの種類を広くする (#1477)
Browse files Browse the repository at this point in the history
* Change: localhostの範囲を拡大

* Code: フォーマット
  • Loading branch information
sevenc-nanashi authored Nov 1, 2024
1 parent fe3eb76 commit 9506de2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion voicevox_engine/app/middlewares.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ async def global_execution_handler(request: Request, exc: Exception) -> Response
app.add_middleware(ServerErrorMiddleware, handler=global_execution_handler)

# CORS用のヘッダを生成するミドルウェア
localhost_regex = "^https?://(localhost|127\\.0\\.0\\.1|\\[::1\\])(:[0-9]+)?$"
localhost_regex = (
r"^[a-zA-Z+\-\.]+://(([^/]+\.)localhost|127\.0\.0\.1|\[::1\])(:[0-9]+)?$"
)
compiled_localhost_regex = re.compile(localhost_regex)
allowed_origins = ["*"]
if cors_policy_mode == "localapps":
Expand Down

0 comments on commit 9506de2

Please sign in to comment.