Skip to content

Commit 0028b05

Browse files
authored
do not set undefined header (#3925)
Signed-off-by: Matteo Collina <[email protected]>
1 parent 9e6d34d commit 0028b05

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/interceptor/cache.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,11 @@ function handleResult (
225225

226226
let headers = {
227227
...opts.headers,
228-
'if-modified-since': new Date(result.cachedAt).toUTCString(),
229-
'if-none-match': result.etag
228+
'if-modified-since': new Date(result.cachedAt).toUTCString()
229+
}
230+
231+
if (result.etag) {
232+
headers.etag = result.etag
230233
}
231234

232235
if (result.vary) {

0 commit comments

Comments
 (0)