diff --git a/storage/http_client.go b/storage/http_client.go index 9c53f1ad82ed..263b077becac 100644 --- a/storage/http_client.go +++ b/storage/http_client.go @@ -790,9 +790,10 @@ func (c *httpStorageClient) NewRangeReader(ctx context.Context, params *newRange func (c *httpStorageClient) newRangeReaderXML(ctx context.Context, params *newRangeReaderParams, s *settings) (r *Reader, err error) { u := &url.URL{ - Scheme: c.scheme, - Host: c.readHost, - Path: fmt.Sprintf("/%s/%s", params.bucket, params.object), + Scheme: c.scheme, + Host: c.readHost, + Path: fmt.Sprintf("/%s/%s", params.bucket, params.object), + RawPath: fmt.Sprintf("/%s/%s", params.bucket, url.PathEscape(params.object)), } verb := "GET" if params.length == 0 { diff --git a/storage/integration_test.go b/storage/integration_test.go index b87ccd72a1cc..9a4427f7a92e 100644 --- a/storage/integration_test.go +++ b/storage/integration_test.go @@ -4002,7 +4002,8 @@ func TestIntegration_Reader(t *testing.T) { "obj2", "obj/with/slashes", "obj/", - // "./obj", // does not work with XML + "./obj", + "!#$&'()*+,/:;=,?@,[] and spaces", } contents := make(map[string][]byte)