mirror of
https://github.com/versity/versitygw.git
synced 2026-01-07 12:15:18 +00:00
fix: Added accept-range, Content-range and x-amz-tagging-count headers in GetObject action response, added test cases for these
This commit is contained in:
@@ -1035,6 +1035,14 @@ func TestRangeGet(s *S3Conf) {
|
||||
}
|
||||
defer out.Body.Close()
|
||||
|
||||
if getString(out.ContentRange) != fmt.Sprintf("bytes 100-200/%v", datalen) {
|
||||
failF("%v: expected content range: %v, instead got: %v", testname, fmt.Sprintf("bytes 100-200/%v", datalen), getString(out.ContentRange))
|
||||
return
|
||||
}
|
||||
if getString(out.AcceptRanges) != rangeString {
|
||||
failF("%v: expected accept range: %v, instead got: %v", testname, rangeString, getString(out.AcceptRanges))
|
||||
}
|
||||
|
||||
b, err := io.ReadAll(out.Body)
|
||||
if err != nil {
|
||||
failF("%v: read body %v", testname, err)
|
||||
|
||||
@@ -154,3 +154,10 @@ func execCommand(args ...string) ([]byte, error) {
|
||||
|
||||
return cmd.CombinedOutput()
|
||||
}
|
||||
|
||||
func getString(str *string) string {
|
||||
if str == nil {
|
||||
return ""
|
||||
}
|
||||
return *str
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user