Skip to content

Commit

Permalink
Don't set content type of not modified action result, as this confuse…
Browse files Browse the repository at this point in the history
…s webkit browsers.
  • Loading branch information
thatismatt committed Jul 9, 2010
1 parent 0979d48 commit 0ca1dfc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/josi/actionresults.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ this.ContentResult = ContentResult = ActionResult.extend({
.addListener('data', function(data){ .addListener('data', function(data){
if (first) { if (first) {
first = false; first = false;
var contentType = utilities.mime.lookup(utilities.extension(filename));
self.headers.push(['Transfer-Encoding', 'chunked']); self.headers.push(['Transfer-Encoding', 'chunked']);
self.headers.push(['Content-Type', utilities.mime.lookup(utilities.extension(filename))]); self.headers.push(['Content-Type', contentType]);
res.writeHead(200, self.headers); res.writeHead(200, self.headers);
} }
res.write(data, 'binary'); res.write(data, 'binary');
Expand Down Expand Up @@ -123,7 +124,7 @@ this.notFound = notFound = function(msg) {
}; };


this.notModified = notModified = function() { this.notModified = notModified = function() {
return new ActionResult(null, [ ['Content-Type', 'text/html'] ], 304); return new ActionResult(null, [], 304);
}; };


this.error = error = function(err, httpStatusCode) { this.error = error = function(err, httpStatusCode) {
Expand Down

0 comments on commit 0ca1dfc

Please sign in to comment.