hlx-url-rewriter
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -57,4 +57,18 @@ const path = require('path'); | ||
print(`\t<<< "${uri}", "${base}"`); | ||
let result; | ||
const obj = createUrl(uri, base); | ||
const result = `${path.join(`/${obj.hostname}`, obj.pathname)}${obj.search}${obj.hash}`; | ||
const scheme = 'file:'; | ||
if (obj.protocol === scheme) { | ||
const filePath = obj.pathname; | ||
if (base && uri.startsWith(scheme)) { | ||
const obj = createUrl(base); | ||
base = obj.pathname; | ||
console.log(`###path.relative(path.dirname(${base}), ${filePath})`); | ||
result = `/${path.relative(path.dirname(base), filePath)}`; | ||
} else { | ||
result = filePath; | ||
} | ||
} else { | ||
result = `${path.join(`/${obj.hostname}`, obj.pathname)}${obj.search}${obj.hash}`; | ||
} | ||
print(`\t>>> "${result}"`); | ||
@@ -61,0 +75,0 @@ return result; |
{ | ||
"name": "hlx-url-rewriter", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "A transform stream to modify URLs contained in HLS playlists", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6886
90