Commit acc9cd00 authored by Ladislav Lhotka's avatar Ladislav Lhotka

Add Access-Control-Allow-Methods header

parent a2cd9b2e
...@@ -24,6 +24,7 @@ CONFIG_HTTP = { ...@@ -24,6 +24,7 @@ CONFIG_HTTP = {
"UPLOAD_SIZE_LIMIT": 1, "UPLOAD_SIZE_LIMIT": 1,
"LISTEN_LOCALHOST_ONLY": False, "LISTEN_LOCALHOST_ONLY": False,
"AC_ALLOW_ORIGIN": "http://localhost:3000", "AC_ALLOW_ORIGIN": "http://localhost:3000",
"AC_ALLOW_METHODS": "POST, GET, OPTIONS, PUT, DELETE",
"PORT": 8443, "PORT": 8443,
"SERVER_SSL_CERT": "server.crt", "SERVER_SSL_CERT": "server.crt",
......
...@@ -180,6 +180,7 @@ class H2Protocol(asyncio.Protocol): ...@@ -180,6 +180,7 @@ class H2Protocol(asyncio.Protocol):
("Server", CONFIG_HTTP["SERVER_NAME"]), ("Server", CONFIG_HTTP["SERVER_NAME"]),
("Cache-Control", "No-Cache"), ("Cache-Control", "No-Cache"),
("Access-Control-Allow-Origin", CONFIG_HTTP["AC_ALLOW_ORIGIN"]), ("Access-Control-Allow-Origin", CONFIG_HTTP["AC_ALLOW_ORIGIN"]),
("Access-Control-Allow-Methods", CONFIG_HTTP["AC_ALLOW_METHODS"]),
("Access-Control-Allow-Headers", "Content-Type") ("Access-Control-Allow-Headers", "Content-Type")
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment