I needed CORS on my entire app, so I used app.add_middleware(CORSMiddleware, ...) with a specific origin. This broke websockets because it caused duplicate headers for requests to /ws/*:
(For some reason this messed up Firefox's CORS verification) So, I tried to explicitly disabling it with cors_allowed_origins=[], but I realized the parameter wasn't being used. This PR fixes that. Note that I changed the default parameter to "*" so that the behavior would remain unchanged.
I needed CORS on my entire app, so I used
app.add_middleware(CORSMiddleware, ...)
with a specific origin. This broke websockets because it caused duplicate headers for requests to/ws/*
:(For some reason this messed up Firefox's CORS verification) So, I tried to explicitly disabling it with
cors_allowed_origins=[]
, but I realized the parameter wasn't being used. This PR fixes that. Note that I changed the default parameter to"*"
so that the behavior would remain unchanged.