1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
Description: Pass Access-Control-Max-Age as a string
Headers should be string/unicode (python 2/3) and this is being violated
when Access-Control-Max-Age is set to 3600. It should be set to '3600'
(str) instead
Author: Benjamin Drung <benjamin.drung@profitbricks.com>
Bug: https://github.com/abourget/gevent-socketio/issues/228
Bug-Debian: https://bugs.debian.org/817902
--- a/socketio/handler.py
+++ b/socketio/handler.py
@@ -74,7 +74,7 @@
("Access-Control-Allow-Origin", self.environ.get('HTTP_ORIGIN', '*')),
("Access-Control-Allow-Credentials", "true"),
("Access-Control-Allow-Methods", "POST, GET, OPTIONS"),
- ("Access-Control-Max-Age", 3600),
+ ("Access-Control-Max-Age", "3600"),
("Content-Type", "text/plain"),
])
self.result = [data]
--- a/socketio/transports.py
+++ b/socketio/transports.py
@@ -21,7 +21,7 @@
("Access-Control-Allow-Origin", "*"),
("Access-Control-Allow-Credentials", "true"),
("Access-Control-Allow-Methods", "POST, GET, OPTIONS"),
- ("Access-Control-Max-Age", 3600),
+ ("Access-Control-Max-Age", "3600"),
]
self.handler = handler
self.config = config
|