Skip to content

Commit

Permalink
Issue #386 [Enhancement][WIP] Handle this.url.root as "/" or "" cases
Browse files Browse the repository at this point in the history
  • Loading branch information
t2ym committed Oct 14, 2020
1 parent 353185f commit 60f7f5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/entry-page/configurator.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const configurator = function (targetConfig) {
let html = String(file.contents);
let whitelist = {...(this['integrityService'].additionalWhitelist || {})};
let blacklist = {...(this['integrityService'].additionalBlacklist || {})};
const entryPageURL = new URL(this.url.root + '/', 'https://localhost');
const entryPageURL = new URL((this.url.root + '/').replace(/\/\/$/, '/'), 'https://localhost');
whitelist[entryPageURL.pathname] = true;
blacklist[new URL(this.path.encodedIndexHtml, entryPageURL).pathname] = true;
let stream = new htmlparser.WritableStream({
Expand Down
2 changes: 1 addition & 1 deletion plugins/frontend-components/configurator.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const configurator = function (targetConfig) {

return this.gulp.src(require(path.resolve(configPath, 'targets.js')).targets.call(this, this, blocked))
.pipe(through.obj((file, enc, callback) => {
file.path = path.resolve(this.path.base, this.path.frontend, this.mapper(this.url.mappings, file.path).substring(1));
file.path = path.resolve(this.path.base, this.path.frontend, this.mapper(this.url.mappings, file.path).replace(/^\//, ''));
file.base = path.resolve(this.path.base, this.path.frontend);
callback(null, file);
}))
Expand Down

0 comments on commit 60f7f5c

Please sign in to comment.