Skip to content

Commit

Permalink
Catch cases of ! Expires: field with no value
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Nov 22, 2023
1 parent bda46d5 commit 9ce9584
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const stringIsNotEmpty = s => typeof s === 'string' && s !== '';

const parseExpires = s => {
const matches = s.match(/(\d+)\s*([dhm]?)/i);
if ( matches === null ) { return 0; }
if ( matches === null ) { return; }
let updateAfter = parseInt(matches[1], 10);
if ( matches[2] === 'h' ) {
updateAfter = Math.max(updateAfter, 4) / 24;
Expand Down

0 comments on commit 9ce9584

Please sign in to comment.