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:
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user