Skip to content

Commit

Permalink
Ensure UTF-8 in the output stream for script source
Browse files Browse the repository at this point in the history
* Fixes a bug where ANSI *(and probably any other encoding types)* is served from uploaded scripts
* Apparently the header CHARSET is somewhat ignored in *node* output streams

Applies to OpenUserJS#200 and wherever file uploading was first added... no issue for that in a search
  • Loading branch information
Martii committed Nov 2, 2015
1 parent 5943154 commit 41bc81e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions controllers/scriptStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ exports.sendScript = function (aReq, aRes, aNext) {
// Disable *express-minify* for this response
aRes._skip = true;

aStream.setEncoding('utf8');
aStream.pipe(aRes);

// Don't count installs on raw source route
Expand Down

0 comments on commit 41bc81e

Please sign in to comment.