Skip to content

Commit

Permalink
fix(aws): CONTENT_LENGTH must set for PUT request
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <github@xuanwo.io>
  • Loading branch information
Xuanwo committed Apr 11, 2023
1 parent 686d297 commit dfa75a6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/aws/credential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::sync::Mutex;
use anyhow::anyhow;
use anyhow::Result;
use async_trait::async_trait;
use http::header::CONTENT_LENGTH;
use quick_xml::de;
use reqwest::Client;
use serde::Deserialize;
Expand Down Expand Up @@ -201,6 +202,7 @@ impl Loader {
let req = self
.client
.put(url)
.header(CONTENT_LENGTH, "0")
.header("x-aws-ec2-metadata-token-ttl-seconds", "60");
let resp = req.send().await?;
if resp.status() != http::StatusCode::OK {
Expand Down

1 comment on commit dfa75a6

@github-actions
Copy link

@github-actions github-actions bot commented on dfa75a6 Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for reqsign ready!

✅ Preview
https://reqsign-bpbr9oq6o-xuanwo.vercel.app

Built with commit dfa75a6.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.