Skip to content

Commit c16b0f1

Browse files
jukkarAnas Nashif
authored andcommitted
net: http: Parsing state was not cleared
If we received a bad HTTP request, then subsequent good requests were also returning 400 error code. The parsing state needs to be initialized after each received HTTP request. Jira: ZEP-2181 Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 08c58b5 commit c16b0f1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

subsys/net/lib/http/http_server.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@ static void http_recv(struct net_context *net_ctx,
670670
}
671671

672672
quit:
673+
http_parser_init(&http_ctx->req.parser, HTTP_REQUEST);
673674
http_ctx->req.data_len = 0;
674675
net_pkt_unref(pkt);
675676
}

0 commit comments

Comments
 (0)