Comparing version 1.1.1 to 1.1.2
10
index.js
@@ -52,6 +52,6 @@ | ||
if (-1 == path) return ctx.error('failed to decode', 400); | ||
if (-1 == path) return ctx.throw('failed to decode', 400); | ||
// null byte(s) | ||
if (~path.indexOf('\0')) return ctx.error('null bytes', 400); | ||
if (~path.indexOf('\0')) return ctx.throw('null bytes', 400); | ||
@@ -62,4 +62,4 @@ // index file support | ||
// malicious path | ||
if (!root && !isAbsolute(path)) return ctx.error('relative paths require the .root option', 500); | ||
if (!root && ~path.indexOf('..')) return ctx.error('malicious path', 400); | ||
if (!root && !isAbsolute(path)) return ctx.throw('relative paths require the .root option', 500); | ||
if (!root && ~path.indexOf('..')) return ctx.throw('malicious path', 400); | ||
@@ -70,3 +70,3 @@ // relative to root | ||
// out of bounds | ||
if (root && 0 != path.indexOf(root)) return ctx.error('malicious path', 400); | ||
if (root && 0 != path.indexOf(root)) return ctx.throw('malicious path', 400); | ||
@@ -73,0 +73,0 @@ // hidden file support, ignore |
@@ -5,3 +5,3 @@ { | ||
"repository": "koajs/send", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "koa", |
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