Inconsistent Header Behavior in `HttpServer.response.stream` Method
Not sure this is expected behavior or a bug, but this first option will cause the
Content-Type
Content-Type
header to be set to
application/octet-stream
application/octet-stream
, which
HttpServer.response.stream
HttpServer.response.stream
applies internally.
const headers = new Headers([['Content-Type', 'text/event-stream']]); // using the native Headers constructor hereconst res = HttpServer.response.stream(myStream).pipe(HttpServer.response.setHeaders(headers))
const headers = new Headers([['Content-Type', 'text/event-stream']]); // using the native Headers constructor hereconst res = HttpServer.response.stream(myStream).pipe(HttpServer.response.setHeaders(headers))
While this second option applies the wanted header correctly: