Closed sau0409 closed 7 months ago
Hmm, yeah this isn't possible. I suppose the header needs to be dynamically determined based on the request.
One idea is to set the Access-Control-Allow-Origin
response header to the value of the request's Host
header if EVENTSTREAM_ALLOW_ORIGIN
is set to an asterisk. What do you think?
Update: the latest version now uses async views instead of channels, which means CORS configuration can now be managed with django-cors-headers.
As per document we can only give single value for EVENTSTREAM_ALLOW_ORIGIN, but in my case I need to allow one more origin. If I try changing EVENTSTREAM_ALLOW_ORIGIN = "*", I get another cors error.