Skip to content

Commit 9fccb18

Browse files
author
Jeremy Williams
committed
Fix issue where iterating headers would miss the last one
1 parent 9d3b00c commit 9fccb18

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

httpserver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,7 @@ int assign_iteration_headers(
887887
int* iter
888888
) {
889889
http_token_t token = request->tokens.buf[*iter];
890+
if (request->tokens.buf[*iter].type == HTTP_BODY) return 0;
890891
*key = (http_string_t) {
891892
.buf = &request->buf[token.index],
892893
.len = token.len
@@ -897,7 +898,6 @@ int assign_iteration_headers(
897898
.buf = &request->buf[token.index],
898899
.len = token.len
899900
};
900-
if (request->tokens.buf[*iter + 1].type == HTTP_BODY) return 0;
901901
return 1;
902902
}
903903

0 commit comments

Comments
 (0)