@kano/desktop-shell
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -15,5 +15,10 @@ const url = require('url'); | ||
const postProcess = opts.postProcess || (s => s); | ||
const authorities = opts.authorities || {}; | ||
return (req, callback) => { | ||
// Parse the url to extract the pathname | ||
const u = url.parse(req.url); | ||
// Authority called host in URLs | ||
const { host } = u; | ||
// Use the root defined in the authorities routing or default ot the default root | ||
const authorityRoot = authorities[host] || root; | ||
let extension = getExtension(u.pathname); | ||
@@ -25,3 +30,3 @@ // If the path contains an extension, it is a request for a file | ||
extension = getExtension(filename); | ||
const file = path.normalize(`${root}/${filename}`); | ||
const file = path.normalize(`${authorityRoot}/${filename}`); | ||
const mimeType = mime.lookup(extension); | ||
@@ -28,0 +33,0 @@ const stream = fs.createReadStream(file); |
{ | ||
"name": "@kano/desktop-shell", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/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
37919
18
828