Disable CORS cache, Fixes: #1445

pull/1448/head
ziajka 6 years ago
parent 2764828f38
commit 78c693ff63

@ -261,15 +261,19 @@ class WebServer:
# Background task started with the server
self._app.on_startup.append(self._on_startup)
resource_options = aiohttp_cors.ResourceOptions(
expose_headers="*", allow_headers="*", max_age=0
)
# Allow CORS for this domains
cors = aiohttp_cors.setup(self._app, defaults={
# Default web server for web gui dev
"http://127.0.0.1:8080": aiohttp_cors.ResourceOptions(expose_headers="*", allow_headers="*"),
"http://localhost:8080": aiohttp_cors.ResourceOptions(expose_headers="*", allow_headers="*"),
"http://127.0.0.1:4200": aiohttp_cors.ResourceOptions(expose_headers="*", allow_headers="*"),
"http://localhost:4200": aiohttp_cors.ResourceOptions(expose_headers="*", allow_headers="*"),
"http://gns3.github.io": aiohttp_cors.ResourceOptions(expose_headers="*", allow_headers="*"),
"https://gns3.github.io": aiohttp_cors.ResourceOptions(expose_headers="*", allow_headers="*")
"http://127.0.0.1:8080": resource_options,
"http://localhost:8080": resource_options,
"http://127.0.0.1:4200": resource_options,
"http://localhost:4200": resource_options,
"http://gns3.github.io": resource_options,
"https://gns3.github.io": resource_options
})
PortManager.instance().console_host = self._host

Loading…
Cancel
Save