sse.js icon indicating copy to clipboard operation
sse.js copied to clipboard

CORS error is missing in the preflight call

Open karakostasi opened this issue 1 year ago • 1 comments

hello! we re getting a CORS error is missing, even though we added the nedded headers. after investigating we saw that in the preflight call the headers look like this:

OPTIONS /url... Access-Control-Request-Method: GET Access-Control-Request-Headers: access-control-allow-origin,authentication-source,authority,authorization,cache-control

if you see the Access-Control-Request-Headers become comma separated and the values are missing.. and the same happens in the normal call that follows.. Any idea if this has happened before or what we can do?

Thanks a lot!

karakostasi avatar Mar 13 '24 14:03 karakostasi

@karakostasi Can you share your code snippet on how you use SSE and configure the headers you're trying to send?

The sse.js library doesn't do any transformation on the headers, it just passes them on to the underlying XMLHttpRequest:

    for (let header in this.headers) {
      this.xhr.setRequestHeader(header, this.headers[header]);
    }

mpetazzoni avatar Mar 13 '24 20:03 mpetazzoni