mirror of
https://github.com/rjNemo/federation
synced 2026-06-09 19:46:40 +00:00
18 lines
364 B
JavaScript
18 lines
364 B
JavaScript
'use strict'
|
|
|
|
module.exports = function isHeaderConditional (headers) {
|
|
if (!headers || typeof headers !== 'object') {
|
|
return false
|
|
}
|
|
|
|
const modifiers = [
|
|
'if-modified-since',
|
|
'if-none-match',
|
|
'if-unmodified-since',
|
|
'if-match',
|
|
'if-range'
|
|
]
|
|
|
|
return Object.keys(headers)
|
|
.some(h => modifiers.indexOf(h.toLowerCase()) !== -1)
|
|
}
|