Commit b835fd90ce

jaina heartles <me@heartles.xyz>
2023-08-10 07:40:51
std.http.Server: use correct header for Transfer-Encoding
1 parent 7ab306d
Changed files (1)
lib
std
lib/std/http/Server.zig
@@ -441,7 +441,7 @@ pub const Response = struct {
 
                 res.transfer_encoding = .{ .content_length = content_length };
             } else if (has_transfer_encoding) {
-                const transfer_encoding = res.headers.getFirstValue("content-length").?;
+                const transfer_encoding = res.headers.getFirstValue("transfer-encoding").?;
                 if (std.mem.eql(u8, transfer_encoding, "chunked")) {
                     res.transfer_encoding = .chunked;
                 } else {