Skip to content

Commit

Permalink
http/server: fix bug with finding header end
Browse files Browse the repository at this point in the history
  • Loading branch information
mookums committed Oct 22, 2024
1 parent f7b2e4e commit 5fb3636
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/http/server.zig
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ pub fn recv_fn(

switch (stage) {
.header => {
const start = provision.recv_buffer.items.len -| 4;
provision.recv_buffer.appendSlice(recv_buffer) catch unreachable;
const header_ends = std.mem.lastIndexOf(u8, provision.recv_buffer.items[start..], "\r\n\r\n");
const header_ends = std.mem.lastIndexOf(u8, provision.recv_buffer.items[0..], "\r\n\r\n");

// Basically, this means we haven't finished processing the header.
if (header_ends == null) {
Expand Down

0 comments on commit 5fb3636

Please sign in to comment.