Skip to content

Fix protocol-relative urls with publicPath #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/GetFilenameFromUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function getFilenameFromUrl(publicPath, outputPath, url) {
var filename;

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

// publicPath has the hostname that is not the same as request url's, should fail
Expand Down
5 changes: 5 additions & 0 deletions test/GetFilenameFromUrl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ describe("GetFilenameFromUrl", function() {
outputPath: "/",
publicPath: "http://other.domain/test/",
expected: false
}, {
url: "/protocol/relative/sample.js",
outputPath: "/",
publicPath: "//test.domain/protocol/relative/",
expected: "/sample.js"
}
];
results.forEach(testUrl);
Expand Down