| author | |
| committer | |
| log | 438d680913393d42754ea1d27c7c50ef1698d0ff |
| tree | d3b853b46dfd53e0ca0f42aa9ee5d92a639656f4 |
| parent | 1d38817f5d7bf3fec6294bfb112f7f9e609078d5 |
The 'Content-Length' header was inspected by mistake,
which makes it effectively impossible to use chunked
Transfer-Encoding when using the http client.
Tested locally with a HTTP server - data is properly sent
with POST method and the proper encoding declared, after the fix.1 files changed, 1 insertions(+), 1 deletions(-)
lib/std/http/Client.zig+1-1| ... | ... | @@ -597,7 +597,7 @@ pub const Request = struct { |
| 597 | 597 | |
| 598 | 598 | req.transfer_encoding = .{ .content_length = content_length }; |
| 599 | 599 | } else if (has_transfer_encoding) { |
| 600 | const transfer_encoding = req.headers.getFirstValue("content-length").?; | |
| 600 | const transfer_encoding = req.headers.getFirstValue("transfer-encoding").?; | |
| 601 | 601 | if (std.mem.eql(u8, transfer_encoding, "chunked")) { |
| 602 | 602 | req.transfer_encoding = .chunked; |
| 603 | 603 | } else { |