s3: accept raw semicolons in query strings (#10305)

* s3: accept raw semicolons in query strings

Go's url.ParseQuery drops any key=value pair containing a raw ';'. A
presigned PUT that signs content-type carries
X-Amz-SignedHeaders=content-type%3Bhost; when a client or proxy decodes
the %3B, the parameter vanished and the upload failed with
MissingFields, while AWS accepts the raw ';' as query data. Re-encode
it before routing so the pair survives parsing and signature
verification.

* iam, iceberg: recover raw-semicolon query pairs on the other listeners

The standalone IAM API verifies SigV4 with a canonical query recomputed
from the parsed query, and Iceberg REST warehouse/parent values may
legally contain ';'. Move the normalization middleware to util/http and
attach it to both routers.
This commit is contained in:
Chris Lu authored and GitHub committed 2026-07-10 12:17:35 -07:00
1 parent ac524e140a
commit 76ec1d8f0f
5 files changed
+80

No files matched your search

+2
View File
@@ -724,6 +724,8 @@ func (s3a *S3ApiServer) UnifiedPostHandler(w http.ResponseWriter, r *http.Reques
}
func (s3a *S3ApiServer) registerRouter(router *mux.Router) {
// runs before subrouter matching so Queries() matchers see the fixed query
router.Use(util_http.EscapeSemicolonsInQuery)
// API Router
apiRouter := router.PathPrefix("/").Subrouter()
apiRouter.Use(request_id.Middleware)