Skip to content

Commit 336c29a

Browse files
authored
Merge pull request #2 from mmalenic/fix/path-context
fix: raw path contains query string
2 parents 43cee81 + f7af05c commit 336c29a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lambda-http/src/request.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,18 +298,19 @@ fn into_vpc_lattice_request(vpclat: VpcLatticeRequestV2) -> http::Request<Body>
298298
let http_method = vpclat.method;
299299
let host = vpclat.headers.get(http::header::HOST).and_then(|s| s.to_str().ok());
300300
let raw_path = vpclat.path.unwrap_or_default();
301+
let raw_path_without_qs = &raw_path[0..raw_path.find("?").unwrap_or(raw_path.len())];
301302

302303
let query_string_parameters = decode_query_map(vpclat.query_string_parameters);
303304
//let multi_value_query_string_parameters = decode_query_map(vpclat.multi_value_query_string_parameters);
304305

305306
let builder = http::Request::builder()
306307
.uri(build_request_uri(
307-
&raw_path,
308+
raw_path_without_qs,
308309
&vpclat.headers,
309310
host,
310311
Some((&query_string_parameters, &query_string_parameters)),
311312
))
312-
.extension(RawHttpPath(raw_path))
313+
.extension(RawHttpPath(raw_path_without_qs.to_string()))
313314
// multi valued query string parameters are always a super
314315
// set of singly valued query string parameters,
315316
// when present, multi-valued query string parameters are preferred

0 commit comments

Comments
 (0)