diff options
author | 2023-06-28 16:00:24 -0400 | |
---|---|---|
committer | 2023-06-29 23:40:47 -0400 | |
commit | f0a3559e93a87fdb2d7b4c88edf60726fcce0265 (patch) | |
tree | d5d69b46429e032aa3a89181f41e4e2cc2a9422a /src/bun.js/api | |
parent | bb697687467b33b47f16d33d2dc8dfcc6ccf7274 (diff) | |
download | bun-f0a3559e93a87fdb2d7b4c88edf60726fcce0265.tar.gz bun-f0a3559e93a87fdb2d7b4c88edf60726fcce0265.tar.zst bun-f0a3559e93a87fdb2d7b4c88edf60726fcce0265.zip |
add a workaround for eventstream headers
i dont really like it
Diffstat (limited to 'src/bun.js/api')
-rw-r--r-- | src/bun.js/api/server.zig | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig index 0e39a23f2..65c85adcf 100644 --- a/src/bun.js/api/server.zig +++ b/src/bun.js/api/server.zig @@ -1961,10 +1961,9 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp // uWS automatically adds the status line if needed // we want to batch network calls as much as possible - if (!(this.response_ptr.?.statusCode() == 200 and this.response_ptr.?.body.init.headers == null)) { - this.renderMetadata(); - } - + // if (!(this.response_ptr.?.statusCode() == 200 and this.response_ptr.?.body.init.headers == null)) { + // } + this.renderMetadata(); stream.value.ensureStillAlive(); var response_stream = this.allocator.create(ResponseStream.JSSink) catch unreachable; @@ -2090,22 +2089,6 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp stream.value.ensureStillAlive(); - // This is commented out for now because new ReadableStream({ type: 'direct' }) - // that doesn't write immediately will cause the request to exit early. - - // const is_in_progress = response_stream.sink.has_backpressure or !(response_stream.sink.wrote == 0 and - // response_stream.sink.buffer.len == 0); - - // if (!stream.isLocked(this.server.globalThis) and !is_in_progress) { - // if (JSC.WebCore.ReadableStream.fromJS(stream.value, this.server.globalThis)) |comparator| { - // if (std.meta.activeTag(comparator.ptr) == std.meta.activeTag(stream.ptr)) { - // streamLog("is not locked", .{}); - // this.renderMissing(); - // return; - // } - // } - // } - this.setAbortHandler(); streamLog("is in progress, but did not return a Promise", .{}); stream.value.unprotect(); |