Use 'allow_methods="*"' in aiohttp_cors.ResourceOptions(). Fixes #2459

This commit is contained in:
grossmj 2024-12-30 11:06:19 +07:00
parent 13b0caef4f
commit 2c727c6bd2
No known key found for this signature in database
GPG Key ID: 1E7DD6DBB53FF3D7

View File

@ -311,7 +311,13 @@ class WebServer:
# Background task started with the server # Background task started with the server
self._app.on_startup.append(self._on_startup) self._app.on_startup.append(self._on_startup)
resource_options = aiohttp_cors.ResourceOptions(allow_credentials=True, expose_headers="*", allow_headers="*", max_age=0) resource_options = aiohttp_cors.ResourceOptions(
allow_credentials=True,
expose_headers="*",
allow_headers="*",
allow_methods="*",
max_age=0
)
# Allow CORS for this domains # Allow CORS for this domains
cors = aiohttp_cors.setup(self._app, defaults={ cors = aiohttp_cors.setup(self._app, defaults={