Skip to content

Commit 63e5996

Browse files
authored
Safer header check (#125)
1 parent 845f309 commit 63e5996

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: lib/headers.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ module.exports = {
4747
const maxAgeRegExp = /max-age=(\d+)/;
4848
let expireSeconds = 0;
4949

50-
if (responseHeaders['cache-control']) {
50+
if (
51+
responseHeaders['cache-control'] &&
52+
responseHeaders['cache-control'].length > 0
53+
) {
5154
if (
5255
responseHeaders['cache-control'][0].indexOf('no-cache') !== -1 ||
5356
responseHeaders['cache-control'][0].indexOf('no-store') !== -1

0 commit comments

Comments
 (0)