| ... | @@ -421,6 +421,7 @@ pub const Server = struct { | ... | @@ -421,6 +421,7 @@ pub const Server = struct { |
| 421 | while (true) { | 421 | while (true) { |
| 422 | const line = try server.reader.readUntilDelimitersBuf(&scratch_buffer, "\r\n"); | 422 | const line = try server.reader.readUntilDelimitersBuf(&scratch_buffer, "\r\n"); |
| 423 | if (line.len == 0) break; | 423 | if (line.len == 0) break; |
| | 424 | if (headers.count() == 128) return error.InvalidRequest; |
| 424 | const name_end = std.mem.indexOfScalar(u8, line, ':') orelse return error.InvalidRequest; | 425 | const name_end = std.mem.indexOfScalar(u8, line, ':') orelse return error.InvalidRequest; |
| 425 | const name = line[0..name_end]; | 426 | const name = line[0..name_end]; |
| 426 | for (name) |*c| { | 427 | for (name) |*c| { |