diff --git a/lib/http_forward.js b/lib/http_forward.js index d9408f997cd9b98433475623409e239c22ea5e4b..d8d9681f577478ba1e150f31690850e9eea2948f 100644 --- a/lib/http_forward.js +++ b/lib/http_forward.js @@ -55,6 +55,18 @@ exports.forward = function(dest, req, res, cb) { if (pres.headers.hasOwnProperty('set-cookie')) { res.setHeader('Set-Cookie', pres.headers['set-cookie']); } + if (pres.headers.hasOwnProperty('vary')) { + res.setHeader('Vary', pres.headers['vary']); + } + if (pres.headers.hasOwnProperty('cache-control')) { + res.setHeader('Cache-Control', pres.headers['cache-control']); + } + if (pres.headers.hasOwnProperty('etag')) { + res.setHeader('ETag', pres.headers['etag']); + } + if (pres.headers.hasOwnProperty('x-frame-options')) { + res.setHeader('X-Frame-Options', pres.headers['x-frame-options']); + } pres.on('data', function (chunk) { res.write(chunk); }).on('end', function() { @@ -87,6 +99,9 @@ exports.forward = function(dest, req, res, cb) { if (req.headers['accept-language']) { preq.setHeader('Accept-Language', req.headers['accept-language']); } + if (req.headers['if-none-match']) { + preq.setHeader('If-None-Match', req.headers['if-none-match']); + } // if the body has already been parsed, we'll write it if (req.body) {