fix request stream parsing
This commit is contained in:
parent
c6cab06245
commit
06b6d4eaa2
1 changed files with 5 additions and 2 deletions
|
@ -43,8 +43,11 @@ pub const Server = struct {
|
||||||
while (true) {
|
while (true) {
|
||||||
_ = try conn.stream.read(chunk_buf[0..]);
|
_ = try conn.stream.read(chunk_buf[0..]);
|
||||||
try buffer.appendSlice(chunk_buf[0..]);
|
try buffer.appendSlice(chunk_buf[0..]);
|
||||||
if (std.mem.indexOf(u8, buffer.items, "\r\n\r\n")) |_| break;
|
if (std.mem.indexOf(u8, buffer.items, "\r\n\r\n")) |_| {
|
||||||
// TODO: Detect Content Length in case of existing request body
|
if (std.mem.indexOf(u8, buffer.items, "Content-Length:")) |_| {
|
||||||
|
// TODO: Detect Content-Length
|
||||||
|
} else break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Build the Request
|
// Build the Request
|
||||||
const req_stream = if (olderVersion) buffer.toOwnedSlice() else try buffer.toOwnedSlice();
|
const req_stream = if (olderVersion) buffer.toOwnedSlice() else try buffer.toOwnedSlice();
|
||||||
|
|
Loading…
Add table
Reference in a new issue