UNPKG

node-tailor

Version:

Tailor assembles a web page from multiple fragments

15 lines (13 loc) 353 B
'use strict'; module.exports = function filterHeaders (attributes, headers) { const newHeaders = {}; if (attributes.public) { return newHeaders; }; ['accept-language', 'referer', 'user-agent'].forEach((key) => { if (headers[key]) { newHeaders[key] = headers[key]; } }); return newHeaders; };