| ... | ... | @@ -142,6 +142,17 @@ test "HTTP server handles a chunked transfer coding request" { |
| 142 | 142 | const stream = try std.net.tcpConnectToHost(gpa, "127.0.0.1", test_server.port()); |
| 143 | 143 | defer stream.close(); |
| 144 | 144 | try stream.writeAll(request_bytes); |
| 145 | |
| 146 | const response = try stream.reader().readAllAlloc(gpa, 100); |
| 147 | defer gpa.free(response); |
| 148 | |
| 149 | const expected_response = |
| 150 | "HTTP/1.1 200 OK\r\n" ++ |
| 151 | "content-length: 21\r\n" ++ |
| 152 | "content-type: text/plain\r\n" ++ |
| 153 | "\r\n" ++ |
| 154 | "message from server!\n"; |
| 155 | try expectEqualStrings(expected_response, response); |
| 145 | 156 | } |
| 146 | 157 | |
| 147 | 158 | test "echo content server" { |