diff --git a/plugins.js b/plugins.js index 2d682997..721990a0 100644 --- a/plugins.js +++ b/plugins.js @@ -43,15 +43,9 @@ module.exports = ( ) => { It will load from ${pl.serveFrom + '-dupe'} instead.` ) pl.serveFrom += '-dupe' } - //trim extra leading slash from serveFrom if necessary - const canonicalUrl = process.env.CANONICAL_URL - const lastBaseChar = canonicalUrl.charAt( canonicalUrl.length - 1 ) - const firstServeFromChar = pl.serveFrom.charAt( 0 ) - if ( lastBaseChar === '/' && firstServeFromChar === '/' ) { - pl.canonicalUrl = process.env.CANONICAL_URL + pl.serveFrom.slice( 1 ) - } - else pl.canonicalUrl = process.env.CANONICAL_URL + pl.serveFrom + pl.canonicalUrl = new URL( pl.serveFrom, process.env.CANONICAL_URL ) + } ) winston.debug( `Found ${plugins.length} plugin(s): ${plugins.map( p => p.name ).join( ', ' )}` )