Skip to content

Commit

Permalink
Fixed header which wasn't being passed through.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgiffard committed Nov 5, 2013
1 parent 12647d9 commit cc4f8bc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,13 @@ function proxy(req,res) {
}

log(
"%s [%s] %s (%dms)",
"%s [%s] %s (%dms) %s %s",
(fromCache ? "CACHE" : "REMOTE"),
String(remoteRes.statusCode)[remoteRes.statusCode>=400?"red":"green"],
req.url.white,
time,
(remoteRes.headers["content-encoding"] || "uncompressed").yellow);
(remoteRes.headers["content-encoding"] || "uncompressed").yellow,
remoteRes.headers["content-type"]);

if (!fromCache && remoteRes.statusCode < 400) {
cache[req.url] = new StreamCache();
Expand All @@ -216,7 +217,8 @@ function proxy(req,res) {
remoteRes.headers["content-type"].match(/^text\/html/i)) {
return rewrite(remoteRes,res);
}


res.setHeader("Content-Type",remoteRes.headers["content-type"]);
remoteRes.pipe(res);
}

Expand Down

0 comments on commit cc4f8bc

Please sign in to comment.