Skip to content

Commit 19c190d

Browse files
authored
Only add URL query if it's not empty (#933)
1 parent 1c63439 commit 19c190d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lambda-http/src/request.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,10 @@ fn into_api_gateway_v2_request(ag: ApiGatewayV2httpRequest) -> http::Request<Bod
129129

130130
let mut uri = build_request_uri(&path, &ag.headers, host, None);
131131
if let Some(query) = ag.raw_query_string {
132-
uri.push('?');
133-
uri.push_str(&query);
132+
if !query.is_empty() {
133+
uri.push('?');
134+
uri.push_str(&query);
135+
}
134136
}
135137

136138
let builder = http::Request::builder()

0 commit comments

Comments
 (0)