Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

storage: Implement StorageHTTPSigner test #49

Merged
merged 6 commits into from Sep 3, 2021
Merged

storage: Implement StorageHTTPSigner test #49

merged 6 commits into from Sep 3, 2021

Conversation

JinnyYi
Copy link
Contributor

@JinnyYi JinnyYi commented Aug 19, 2021

go.mod Outdated Show resolved Hide resolved
http_signer.go Outdated
}

path := uuid.New().String()
req, err := signer.QuerySignHTTP(types.OpStoragerWrite, path, time.Duration(time.Hour))
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to set size here?

I think we need a demo to make sure our test logic is correct. Maybe in s3?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we need to set size here?

Dose it mean set Content-Length? I tried to add req.Header.Add("Content-Length", strconv.FormatInt(size,10)) and tested with qingstor, the request was successful, but the request is chunked transfer encoding. So I removed the content-length setting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the comment for Header in http.Request, for client requests, certain headers such as Content-Length and Connection are automatically written when needed and values in Header may be ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we need a demo to make sure our test logic is correct. Maybe in s3?

I'll privde a demo.

Copy link
Contributor

Choose a reason for hiding this comment

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

chunked transfer encoding

Strange, chunked transfer encoding should be used for requests that don't have content-length header.

Let's discuss the detail in the demo of s3 instead.

@JinnyYi JinnyYi changed the title storage: Implement HTTPSigner test storage: Implement StorageHTTPSigner test Sep 1, 2021
@JinnyYi JinnyYi requested a review from Xuanwo September 3, 2021 02:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants