forked from TrueCloudLab/frostfs-s3-gw
[#563] Ignore precondition headers with invalid date format
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
This commit is contained in:
parent
a12fea8a5b
commit
e3141fc8e3
7 changed files with 43 additions and 31 deletions
|
@ -68,6 +68,16 @@ func TestConditionalHead(t *testing.T) {
|
|||
api.IfModifiedSince: zeroTime.UTC().Format(http.TimeFormat),
|
||||
}
|
||||
headObject(t, tc, bktName, objName, headers, http.StatusNotModified)
|
||||
|
||||
headers = map[string]string{
|
||||
api.IfUnmodifiedSince: zeroTime.UTC().Format(time.RFC3339), // invalid format, header is ignored
|
||||
}
|
||||
headObject(t, tc, bktName, objName, headers, http.StatusOK)
|
||||
|
||||
headers = map[string]string{
|
||||
api.IfModifiedSince: objInfo.Created.Add(time.Minute).Format(time.RFC3339), // invalid format, header is ignored
|
||||
}
|
||||
headObject(t, tc, bktName, objName, headers, http.StatusOK)
|
||||
}
|
||||
|
||||
func headObject(t *testing.T, tc *handlerContext, bktName, objName string, headers map[string]string, status int) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue