Skip to content

Commit d58086e

Browse files
committed
do not export host
1 parent 27dd934 commit d58086e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

object_store/src/gcp/credential.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ pub const DEFAULT_SIGN_BLOG_SCOPE: &str = "https://www.googleapis.com/auth/cloud
5252
pub const DEFAULT_GCS_BASE_URL: &str = "https://storage.googleapis.com";
5353

5454
const DEFAULT_GCS_PLAYLOAD_STRING: &str = "UNSIGNED-PAYLOAD";
55+
const DEFAULT_GCS_SIGN_BLOB_HOST: &str = "storage.googleapis.com";
5556

5657
#[derive(Debug, Snafu)]
5758
pub enum Error {
@@ -680,7 +681,6 @@ impl GCSAuthorizer {
680681
method: Method,
681682
url: &mut Url,
682683
expires_in: Duration,
683-
host: &str,
684684
client: &GoogleCloudStorageClient,
685685
) -> crate::Result<()> {
686686
let client_email = self
@@ -693,7 +693,7 @@ impl GCSAuthorizer {
693693
let credential_with_scope = format!("{}/{}", client_email, scope);
694694

695695
let mut headers = HeaderMap::new();
696-
headers.insert("host", host.parse().unwrap());
696+
headers.insert("host", DEFAULT_GCS_SIGN_BLOB_HOST.parse().unwrap());
697697

698698
let (_, signed_headers) = Self::canonicalize_headers(&headers);
699699

object_store/src/gcp/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl Signer for GoogleCloudStorage {
253253
let authoriztor = GCSAuthorizer::new(sign_credential);
254254

255255
authoriztor
256-
.sign(method, &mut url, expires_in, DEFAULT_HOST, &self.client)
256+
.sign(method, &mut url, expires_in, &self.client)
257257
.await?;
258258

259259
Ok(url)

0 commit comments

Comments
 (0)