storage: Implement StorageHTTPSigner test #49
Conversation
http_signer.go
Outdated
} | ||
|
||
path := uuid.New().String() | ||
req, err := signer.QuerySignHTTP(types.OpStoragerWrite, path, time.Duration(time.Hour)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
ref: beyondstorage/go-storage#707