diff --git a/gns3server/api/server.py b/gns3server/api/server.py index b4f6e4ca..d0f14d78 100644 --- a/gns3server/api/server.py +++ b/gns3server/api/server.py @@ -53,22 +53,9 @@ def get_application() -> FastAPI: title="GNS3 controller API", description="This page describes the public controller API for GNS3", version="v3" ) - origins = [ - "http://127.0.0.1", - "http://localhost", - "http://localhost:4200", - "http://127.0.0.1:4200" - "http://127.0.0.1:8080", - "http://localhost:8080", - "http://127.0.0.1:3080", - "http://localhost:3080", - "http://gns3.github.io", - "https://gns3.github.io", - ] - application.add_middleware( CORSMiddleware, - allow_origins=origins, + allow_origin_regex=r"http(s)?://(localhost|127.0.0.1)(:\d+)?", allow_credentials=True, allow_methods=["*"], allow_headers=["*"],