From 8565f7dc314f194ba85e9a0c8a021b9565c22e36 Mon Sep 17 00:00:00 2001 From: trinity-1686a Date: Tue, 22 Mar 2022 18:20:39 +0100 Subject: cleanup --- src/garage/tests/common/custom_requester.rs | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/garage/tests/common/custom_requester.rs b/src/garage/tests/common/custom_requester.rs index 11dc10d6..580691a1 100644 --- a/src/garage/tests/common/custom_requester.rs +++ b/src/garage/tests/common/custom_requester.rs @@ -22,16 +22,6 @@ pub struct CustomRequester { impl CustomRequester { pub fn new(instance: &Instance) -> Self { - /* - let credentials = Credentials::new( - &instance.key.id, - &instance.key.secret, - None, - None, - "garage-integ-test", - ); - let endpoint = Endpoint::immutable(instance.uri()); - */ CustomRequester { key: instance.key.clone(), uri: instance.uri(), @@ -53,13 +43,6 @@ impl CustomRequester { vhost_style: false, } } - /* - pub async fn request(&self, method: &str, path: String, headers: &HashMap, body: &[u8], vhost_style: bool) -> hyper::Result> { - let request = Request::builder() - .method( - self.client.request(todo!()).await - } - */ } pub struct RequestBuilder<'a> { @@ -160,8 +143,10 @@ impl<'a> RequestBuilder<'a> { "x-amz-decoded-content-length".to_owned(), self.body.len().to_string(), ); - // this is a pretty lazy and inefficient way to do it, but it's enought for - // test code. + // Get lenght of body by doing the conversion to a streaming body with an + // invalid signature (we don't know the seed) just to get its length. This + // is a pretty lazy and inefficient way to do it, but it's enought for test + // code. all_headers.insert( "content-length".to_owned(), to_streaming_body(&self.body, size, String::new(), signer.clone(), now, "") -- cgit v1.2.3