@@ -32,6 +32,8 @@ beforeEach(() => {
32
32
httpStatusCode : 200 ,
33
33
size : 3746 ,
34
34
mimetype : 'image/png' ,
35
+ lastModified : new Date ( 'Thu, 12 Aug 2021 16:00:00 GMT' ) ,
36
+ eTag : 'abc' ,
35
37
} ,
36
38
body : Buffer . from ( '' ) ,
37
39
} )
@@ -76,6 +78,8 @@ describe('testing GET object', () => {
76
78
} ,
77
79
} )
78
80
expect ( response . statusCode ) . toBe ( 200 )
81
+ expect ( response . headers [ 'etag' ] ) . toBe ( 'abc' )
82
+ expect ( response . headers [ 'last-modified' ] ) . toBe ( 'Thu, 12 Aug 2021 16:00:00 GMT' )
79
83
expect ( S3Backend . prototype . getObject ) . toBeCalled ( )
80
84
} )
81
85
@@ -91,13 +95,13 @@ describe('testing GET object', () => {
91
95
url : '/object/authenticated/bucket2/authenticated/casestudy.png' ,
92
96
headers : {
93
97
authorization : `Bearer ${ process . env . AUTHENTICATED_KEY } ` ,
94
- 'if-modified-since' : 'Fri Aug 13 2021 00 :00:00 GMT+0800 (Singapore Standard Time) ' ,
98
+ 'if-modified-since' : 'Thu, 12 Aug 2021 16 :00:00 GMT' ,
95
99
'if-none-match' : 'abc' ,
96
100
} ,
97
101
} )
98
102
expect ( response . statusCode ) . toBe ( 304 )
99
103
expect ( mockGetObject . mock . calls [ 0 ] [ 2 ] ) . toMatchObject ( {
100
- ifModifiedSince : 'Fri Aug 13 2021 00 :00:00 GMT+0800 (Singapore Standard Time) ' ,
104
+ ifModifiedSince : 'Thu, 12 Aug 2021 16 :00:00 GMT' ,
101
105
ifNoneMatch : 'abc' ,
102
106
} )
103
107
} )
@@ -1246,6 +1250,8 @@ describe('testing retrieving signed URL', () => {
1246
1250
url : `/object/sign/${ urlToSign } ?token=${ jwtToken } ` ,
1247
1251
} )
1248
1252
expect ( response . statusCode ) . toBe ( 200 )
1253
+ expect ( response . headers [ 'etag' ] ) . toBe ( 'abc' )
1254
+ expect ( response . headers [ 'last-modified' ] ) . toBe ( 'Thu, 12 Aug 2021 16:00:00 GMT' )
1249
1255
} )
1250
1256
1251
1257
test ( 'forward 304 and If-Modified-Since/If-None-Match headers' , async ( ) => {
@@ -1261,13 +1267,13 @@ describe('testing retrieving signed URL', () => {
1261
1267
method : 'GET' ,
1262
1268
url : `/object/sign/${ urlToSign } ?token=${ jwtToken } ` ,
1263
1269
headers : {
1264
- 'if-modified-since' : 'Fri Aug 13 2021 00 :00:00 GMT+0800 (Singapore Standard Time) ' ,
1270
+ 'if-modified-since' : 'Thu, 12 Aug 2021 16 :00:00 GMT' ,
1265
1271
'if-none-match' : 'abc' ,
1266
1272
} ,
1267
1273
} )
1268
1274
expect ( response . statusCode ) . toBe ( 304 )
1269
1275
expect ( mockGetObject . mock . calls [ 0 ] [ 2 ] ) . toMatchObject ( {
1270
- ifModifiedSince : 'Fri Aug 13 2021 00 :00:00 GMT+0800 (Singapore Standard Time) ' ,
1276
+ ifModifiedSince : 'Thu, 12 Aug 2021 16 :00:00 GMT' ,
1271
1277
ifNoneMatch : 'abc' ,
1272
1278
} )
1273
1279
} )
0 commit comments