Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/http_server/flb_http_server_http1.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ static int http1_session_process_request(struct flb_http1_server_session *sessio
{
struct mk_list *iterator;
struct mk_http_header *header;
cfl_sds_t sds_result;
int result;
size_t chunked_size;
size_t written_bytes = 0;
Expand Down Expand Up @@ -130,6 +131,27 @@ static int http1_session_process_request(struct flb_http1_server_session *sessio
return -1;
}

if (session->inner_request.query_string.data != NULL &&
session->inner_request.query_string.len > 0) {
Comment on lines +134 to +135

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add HTTP/1 query-string regression coverage

Add an automated HTTP/1 case that sends a query string and asserts the callback receives the expected request->path and request->query_string; this protocol-parsing behavior is currently validated only by the manual reproduction in the commit message, so the original regression or HTTP/1/HTTP/2 divergence could return unnoticed. The repository explicitly requires tests for behavior changes, especially protocol parsing.

AGENTS.md reference: AGENTS.md:L83-L85

Useful? React with 👍 / 👎.

sds_result = cfl_sds_cat(session->stream.request.path, "?", 1);

if (sds_result == NULL) {
return -1;
}

session->stream.request.path = sds_result;

sds_result = cfl_sds_cat(session->stream.request.path,
session->inner_request.query_string.data,
session->inner_request.query_string.len);

if (sds_result == NULL) {
return -1;
}

session->stream.request.path = sds_result;
}

result = flb_http_request_normalize(&session->stream.request);
if (result != 0) {
return -1;
Expand Down
Loading