Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix issue 35 - Safari hangs randomly on page refresh; Do not send con…

…tent length, type or such if no content is sent
  • Loading branch information...
commit 895e62ed042e9aaeeb633c92c3d4cedd975f7bb0 1 parent c58d8d7
@laurisvan laurisvan authored
Showing with 7 additions and 6 deletions.
  1. +7 −6 lib/assetmanager.js
View
13 lib/assetmanager.js
@@ -383,8 +383,6 @@ module.exports = function assetManager (assets) {
}
function serveContent(response) {
var headers = {
- 'Content-Type': mimeType,
- 'Content-Length': response.contentLength,
'Last-Modified': response.modified,
'Date': (new Date).toUTCString(),
'Cache-Control': 'public,max-age=' + 31536000,
@@ -392,15 +390,18 @@ module.exports = function assetManager (assets) {
'Vary': 'Accept-Encoding'
};
- if(response.encoding) {
- headers['Content-Encoding'] = response.encoding
- }
-
if (req.headers['if-modified-since'] &&
Date.parse(req.headers['if-modified-since']) >= Date.parse(response.modified)) {
res.writeHead(304, headers);
res.end();
} else {
+ headers['Content-Type'] = mimeType;
+ headers['Content-Length'] = response.contentLength;
+
+ if(response.encoding) {
+ headers['Content-Encoding'] = response.encoding
+ }
+
res.writeHead(200, headers);
res.end(response.contentBuffer);
}
Please sign in to comment.
Something went wrong with that request. Please try again.