Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fixes safari caching problem. #4

Merged
merged 1 commit into from over 1 year ago

2 participants

Brian Link Carlos Rodriguez
Brian Link

Don't send Content-Encoding or Content-Length when sending null body.

Brian Link Fixes safari caching problem.
Don't send Content-Encoding or Content-Length when sending null body.
fee0ece
Carlos Rodriguez carlos8f merged commit f01e25f into from September 14, 2012
Carlos Rodriguez carlos8f closed this September 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 14, 2012
Brian Link Fixes safari caching problem.
Don't send Content-Encoding or Content-Length when sending null body.
fee0ece
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  lib/file.js
4  lib/file.js
@@ -96,6 +96,10 @@ File.prototype.serve = function(req, res, status) {
96 96
     if (req.method === 'HEAD') {
97 97
       body = null;
98 98
     }
  99
+    if (!body) {
  100
+      delete(headers['Content-Encoding']);
  101
+      delete(headers['Content-Length']);
  102
+    }
99 103
 
100 104
     if (this.keepAlive && ((res.response && res.response.shouldKeepAlive) || res.shouldKeepAlive)) {
101 105
       headers['Keep-Alive'] = 'timeout=' + this.keepAlive;
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.