hyperdrive-http
Advanced tools
Comparing version 3.4.0 to 3.4.1
17
index.js
@@ -24,3 +24,3 @@ var pump = require('pump') | ||
getArchive(datUrl, function (err, archive) { | ||
if (err) return onerror(err) | ||
if (err) return onerror(err, res) | ||
archiveResponse(datUrl, archive, req, res) | ||
@@ -40,5 +40,14 @@ }) | ||
try { | ||
// check if we are serving archive at root | ||
key = key.replace(/\.changes$/, '') | ||
encoding.decode(key) | ||
} catch (e) { | ||
if (!filename) filename = key | ||
key = null | ||
} | ||
if (/\.changes$/.test(req.url)) { | ||
op = 'changes' | ||
filename = filename.replace(/\.changes$/, '') | ||
if (filename) filename = filename.replace(/\.changes$/, '') | ||
} else if (req.method === 'POST') { | ||
@@ -108,4 +117,8 @@ op = 'upload' | ||
function onerror (status, res) { | ||
if (typeof status !== 'number') { | ||
console.error(status) | ||
status = 404 | ||
} | ||
res.statusCode = status | ||
res.end() | ||
} |
{ | ||
"name": "hyperdrive-http", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"description": "Handle Hyperdrive HTTP Requests", | ||
@@ -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
19059
395