Send mint-token requests with a proper Content-Type (#18334)

## Summary

Using `.body()` meant that the request was sent without a
`Content-Type`, whereas we want to explicitly communicate that the
mint-token request is a JSON payload. Using `.json()` causes request to
send the `Content-Type` header by default.

## Test Plan

Existing coverage.

---------

Signed-off-by: William Woodruff <william@astral.sh>
This commit is contained in:
William Woodruff
2026-03-07 21:03:05 +08:00
committed by GitHub
parent f675560f32
commit e30c081d5a
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ futures = { workspace = true }
glob = { workspace = true }
itertools = { workspace = true }
reqwest = { workspace = true }
reqwest-middleware = { workspace = true }
reqwest-middleware = { workspace = true, features = ["json"] }
reqwest-retry = { workspace = true }
rustc-hash = { workspace = true }
serde = { workspace = true, features = ["derive"] }
@@ -83,7 +83,7 @@ impl TrustedPublishingService for PyPIPublishingService<'_> {
let response = self
.client
.post(Url::from(mint_token_url.clone()))
.body(serde_json::to_vec(&mint_token_payload)?)
.json(&mint_token_payload)
.send()
.await
.map_err(|err| {
@@ -109,7 +109,7 @@ impl TrustedPublishingService for PyxPublishingService<'_> {
let response = self
.client
.post(Url::from(mint_token_url.clone()))
.body(serde_json::to_vec(&mint_token_payload)?)
.json(&mint_token_payload)
.send()
.await
.map_err(|err| {