This commit is contained in:
trinity-1686a 2022-03-22 18:20:39 +01:00 committed by Gitea
parent 8db6b84559
commit 8565f7dc31

View file

@ -22,16 +22,6 @@ pub struct CustomRequester {
impl CustomRequester { impl CustomRequester {
pub fn new(instance: &Instance) -> Self { 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 { CustomRequester {
key: instance.key.clone(), key: instance.key.clone(),
uri: instance.uri(), uri: instance.uri(),
@ -53,13 +43,6 @@ impl CustomRequester {
vhost_style: false, vhost_style: false,
} }
} }
/*
pub async fn request(&self, method: &str, path: String, headers: &HashMap<String, (bool, String)>, body: &[u8], vhost_style: bool) -> hyper::Result<Response<Body>> {
let request = Request::builder()
.method(
self.client.request(todo!()).await
}
*/
} }
pub struct RequestBuilder<'a> { pub struct RequestBuilder<'a> {
@ -160,8 +143,10 @@ impl<'a> RequestBuilder<'a> {
"x-amz-decoded-content-length".to_owned(), "x-amz-decoded-content-length".to_owned(),
self.body.len().to_string(), self.body.len().to_string(),
); );
// this is a pretty lazy and inefficient way to do it, but it's enought for // Get lenght of body by doing the conversion to a streaming body with an
// test code. // 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( all_headers.insert(
"content-length".to_owned(), "content-length".to_owned(),
to_streaming_body(&self.body, size, String::new(), signer.clone(), now, "") to_streaming_body(&self.body, size, String::new(), signer.clone(), now, "")