Skip to content

Commit 6c1b473

Browse files
committed
Fix files with non-ascii names not getting served
Closes #171
1 parent a34ae3e commit 6c1b473

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/GetFilenameFromUrl.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var urlParse = require("url").parse;
33

44
function getFilenameFromUrl(publicPath, outputPath, url) {
55
var filename;
6+
url = decodeURIComponent(url);
67

78
// localPrefix is the folder our bundle should be in
89
var localPrefix = urlParse(publicPath || "/", false, true);

test/GetFilenameFromUrl.test.js

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ describe("GetFilenameFromUrl", function() {
1414
outputPath: "/",
1515
publicPath: "/",
1616
expected: "/foo.js"
17+
}, {
18+
url: "/f%C3%B6%C3%B6.js", // Express encodes the URI component, so we do the same
19+
outputPath: "/",
20+
publicPath: "/",
21+
expected: "/föö.js"
1722
}, {
1823
url: "/0.19dc5d417382d73dd190.hot-update.js",
1924
outputPath: "/",

0 commit comments

Comments
 (0)