Permalink
Browse files

Fixes safari caching problem.

Don't send Content-Encoding or Content-Length when sending null body.
  • Loading branch information...
cpsubrian committed Sep 14, 2012
1 parent 3b6e3ed commit fee0ecec81b881435c9eaf522fe5b6841de14bf1
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/file.js
View
@@ -96,6 +96,10 @@ File.prototype.serve = function(req, res, status) {
if (req.method === 'HEAD') {
body = null;
}
+ if (!body) {
+ delete(headers['Content-Encoding']);
+ delete(headers['Content-Length']);
+ }
if (this.keepAlive && ((res.response && res.response.shouldKeepAlive) || res.shouldKeepAlive)) {
headers['Keep-Alive'] = 'timeout=' + this.keepAlive;

0 comments on commit fee0ece

Please sign in to comment.