Skip to content

Commit

Permalink
UTC date headers
Browse files Browse the repository at this point in the history
  • Loading branch information
evantahler committed Jun 30, 2016
1 parent 4ab8730 commit f5958a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions servers/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f5958a9

Please sign in to comment.