| ... | ... | @@ -645,7 +645,6 @@ pub const Request = struct { |
| 645 | 645 | if (req.response.parser.state.isContent()) break; |
| 646 | 646 | } |
| 647 | 647 | |
| 648 | | req.response.headers = http.Headers{ .allocator = req.client.allocator, .owned = false }; |
| 649 | 648 | try req.response.parse(req.response.parser.header_bytes.items); |
| 650 | 649 | |
| 651 | 650 | if (req.response.status == .switching_protocols) { |
| ... | ... | @@ -765,7 +764,7 @@ pub const Request = struct { |
| 765 | 764 | } |
| 766 | 765 | |
| 767 | 766 | if (has_trail) { |
| 768 | | req.response.headers = http.Headers{ .allocator = req.client.allocator, .owned = false }; |
| 767 | req.response.headers.clearRetainingCapacity(); |
| 769 | 768 | |
| 770 | 769 | // The response headers before the trailers are already guaranteed to be valid, so they will always be parsed again and cannot return an error. |
| 771 | 770 | // This will *only* fail for a malformed trailer. |
| ... | ... | @@ -1019,7 +1018,7 @@ pub fn request(client: *Client, method: http.Method, uri: Uri, headers: http.Hea |
| 1019 | 1018 | .status = undefined, |
| 1020 | 1019 | .reason = undefined, |
| 1021 | 1020 | .version = undefined, |
| 1022 | | .headers = undefined, |
| 1021 | .headers = http.Headers{ .allocator = client.allocator, .owned = false }, |
| 1023 | 1022 | .parser = switch (options.header_strategy) { |
| 1024 | 1023 | .dynamic => |max| proto.HeadersParser.initDynamic(max), |
| 1025 | 1024 | .static => |buf| proto.HeadersParser.initStatic(buf), |