Skip to content

Fix max age header for Daphne #14

@moritz89

Description

@moritz89

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()]
                            )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions