Skip to content

CORS Issue AsyncHttpConsumer #1247

@waqasraz

Description

@waqasraz

Access to XMLHttpRequest at 'http://127.0.0.1:8001/test_middleware/' from origin 'http://127.0.0.1:8082' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Adding a header to each send response solve the above problem but I don't want to add a header to each response.

self.send_response(200, b"xxx"
headers=[
                (b"Content-Type", b"application/json"),
                (b"Access-Control-Allow-Origin", b"*"),
            ]
)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions