flipfloptech commented on code in PR #435:
URL:
https://github.com/apache/arrow-rs-object-store/pull/435#discussion_r2202199733
##########
src/client/builder.rs:
##########
@@ -181,9 +181,28 @@ impl HttpRequestBuilder {
pub(crate) fn query<T: serde::Serialize + ?Sized>(mut self, query: &T) ->
Self {
let mut error = None;
if let Ok(ref mut req) = self.request {
- let mut out = format!("{}?", req.uri().path());
- let start_position = out.len();
- let mut encoder = form_urlencoded::Serializer::for_suffix(&mut
out, start_position);
+ // Build the query string, preserving any existing query
parameters.
+ // This prevents malformed URIs like "/bucket?&list-type=2" when
the URI
+ // already contains query parameters.
Review Comment:
Not sure if it's really a bug in the library. A query string that starts
with an ampersand works fine in php($_GET["var"]) and python3 urllib parse_qs.
I am also unable to find any RFC or protocol specification that outlines that a
query string should not/cannot begin with an ampersand.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]