From f5958a97916fdab044e898958bfe0ee538a7a941 Mon Sep 17 00:00:00 2001 From: Evan Tahler Date: Thu, 30 Jun 2016 11:12:20 -0700 Subject: [PATCH] UTC date headers --- servers/web.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/web.js b/servers/web.js index 67981e0b8c..0a1a69c567 100644 --- a/servers/web.js +++ b/servers/web.js @@ -101,13 +101,13 @@ var initialize = function(api, options, next){ }); reqHeaders = connection.rawConnection.req.headers; - if(reqHeaders['if-modified-since']){ ifModifiedSince = new Date(reqHeaders['if-modified-since']); } + if(reqHeaders['if-modified-since']){ ifModifiedSince = new Date(reqHeaders['if-modified-since']).toUTCString(); } connection.rawConnection.responseHeaders.push(['Content-Type', mime]); if(fileStream){ if(foundExpires === false){ connection.rawConnection.responseHeaders.push(['Expires', new Date(new Date().getTime() + api.config.servers.web.flatFileCacheDuration * 1000).toUTCString()]); } if(foundCacheControl === false){ connection.rawConnection.responseHeaders.push(['Cache-Control', 'max-age=' + api.config.servers.web.flatFileCacheDuration + ', must-revalidate, public']); } - if(lastModified){ connection.rawConnection.responseHeaders.push(['Last-Modified', new Date(lastModified)]); } + if(lastModified){ connection.rawConnection.responseHeaders.push(['Last-Modified', new Date(lastModified).toUTCString()]); } } cleanHeaders(connection); var headers = connection.rawConnection.responseHeaders;