Skip to content

Commit

Permalink
Fix files with non-ascii names not getting served
Browse files Browse the repository at this point in the history
Closes #171
  • Loading branch information
SpaceK33z committed Feb 18, 2017
1 parent a34ae3e commit 6c1b473
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/GetFilenameFromUrl.js
Expand Up @@ -3,6 +3,7 @@ var urlParse = require("url").parse;

function getFilenameFromUrl(publicPath, outputPath, url) {
var filename;
url = decodeURIComponent(url);

// localPrefix is the folder our bundle should be in
var localPrefix = urlParse(publicPath || "/", false, true);
Expand Down
5 changes: 5 additions & 0 deletions test/GetFilenameFromUrl.test.js
Expand Up @@ -14,6 +14,11 @@ describe("GetFilenameFromUrl", function() {
outputPath: "/",
publicPath: "/",
expected: "/foo.js"
}, {
url: "/f%C3%B6%C3%B6.js", // Express encodes the URI component, so we do the same
outputPath: "/",
publicPath: "/",
expected: "/föö.js"
}, {
url: "/0.19dc5d417382d73dd190.hot-update.js",
outputPath: "/",
Expand Down

0 comments on commit 6c1b473

Please sign in to comment.