From 68c5a293eb8f35eeccdc8c1e5cec6bc390137fc0 Mon Sep 17 00:00:00 2001 From: Ciro Spaciari Date: Thu, 4 Sep 2025 12:24:53 -0700 Subject: [PATCH] opsie --- src/http.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/http.zig b/src/http.zig index 5f1e55f770..d7c699b589 100644 --- a/src/http.zig +++ b/src/http.zig @@ -1033,6 +1033,9 @@ fn writeToStreamUsingBuffer(this: *HTTPClient, comptime is_ssl: bool, socket: Ne } pub fn writeToStream(this: *HTTPClient, comptime is_ssl: bool, socket: NewHTTPContext(is_ssl).HTTPSocket, data: []const u8) void { log("flushStream", .{}); + if (this.state.original_request_body != .stream) { + return; + } var stream = &this.state.original_request_body.stream; const stream_buffer = stream.buffer orelse return; if (this.flags.upgrade_state == .pending) { @@ -1399,7 +1402,7 @@ pub fn handleOnDataHeaders( } // handle the case where we have a 100 Continue - if (response.status_code >= 100 and response.status_code < 200) { + if (response.status_code >= 100 and response.status_code < 200 and to_read.len > 0) { log("information headers", .{}); // we still can have the 200 OK in the same buffer sometimes // 1XX responses MUST NOT include a message-body, therefore we need to continue parsing