TestForwardUncachedPreservesQueryString covers AWS S3 multipart-upload query params (?uploads, ?partNumber=N&uploadId=...). Sigv4's canonical request includes the query string, so any mutation would 403.
(t *testing.T)
| 1283 | // request. After the fix, the outbound request must carry over the inbound's |
| 1284 | // ContentLength so the wire shape is preserved. |
| 1285 | func TestForwardUncachedPropagatesContentLength(t *testing.T) { |
| 1286 | proxy := newTestProxy(t) |
| 1287 | payload := []byte("parquet-bytes-of-known-length") |
| 1288 | |
| 1289 | var ( |
| 1290 | gotMethod string |
| 1291 | gotContentLength int64 |
| 1292 | gotTE string |
| 1293 | gotBody []byte |
| 1294 | ) |
| 1295 | _, originURL := newTestServer(t, func(w http.ResponseWriter, r *http.Request) { |
| 1296 | gotMethod = r.Method |
| 1297 | gotContentLength = r.ContentLength |
| 1298 | gotTE = r.Header.Get("Transfer-Encoding") |
| 1299 | // httputil sometimes also strips Transfer-Encoding into r.TransferEncoding |
| 1300 | if gotTE == "" && len(r.TransferEncoding) > 0 { |
| 1301 | gotTE = strings.Join(r.TransferEncoding, ",") |
| 1302 | } |
| 1303 | gotBody, _ = io.ReadAll(r.Body) |
| 1304 | w.WriteHeader(http.StatusOK) |
| 1305 | }) |
| 1306 |
nothing calls this directly
no test coverage detected