Open yunusyuksel opened 1 year ago
That check to content type "text/event-stream" causes an error, if to content type additional params are added like "charset=utf-8". See here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type. we may check the substring of content type?
if ( responseHeaders && responseHeaders['content-type'] !== 'text/event-stream' ) { this.dispatchEvent({ type: 'error', data: 'unsupported MIME type in response: ' + responseHeaders['content-type'], }); return this.close(); } else if (!responseHeaders) { this.dispatchEvent({ type: 'error', data: 'no MIME type in response', }); return this.close(); }
That check to content type "text/event-stream" causes an error, if to content type additional params are added like "charset=utf-8". See here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type. we may check the substring of content type?
if ( responseHeaders && responseHeaders['content-type'] !== 'text/event-stream' ) { this.dispatchEvent({ type: 'error', data: 'unsupported MIME type in response: ' + responseHeaders['content-type'], }); return this.close(); } else if (!responseHeaders) { this.dispatchEvent({ type: 'error', data: 'no MIME type in response', }); return this.close(); }