Max age header throws an error when used with Daphne as the age is returned as a string (str) type and not a bytes type.
The fix would be to add encode():
# asgi_cors.py
if max_age:
new_headers.append(
[b"access-control-max-age", str(max_age).encode()]
)
Max age header throws an error when used with Daphne as the age is returned as a string (str) type and not a bytes type.
The fix would be to add
encode():