Comparing version 1.2.2 to 1.2.3
13
index.js
@@ -1,2 +0,1 @@ | ||
/** | ||
@@ -6,3 +5,3 @@ * Module dependencies. | ||
var onSocketError = require('on-socket-error'); | ||
var onFinished = require('finished'); | ||
var debug = require('debug')('koa-send'); | ||
@@ -37,3 +36,3 @@ var assert = require('assert'); | ||
assert(ctx, 'koa context required'); | ||
assert(path, 'path path required'); | ||
assert(path, 'pathname required'); | ||
opts = opts || {}; | ||
@@ -43,3 +42,3 @@ | ||
debug('send "%s" %j', path, opts); | ||
var root = opts.root ? resolve(opts.root) : ''; | ||
var root = opts.root ? normalize(resolve(opts.root)) : ''; | ||
var index = opts.index; | ||
@@ -93,5 +92,3 @@ var maxage = opts.maxage || 0; | ||
var stream = this.body = fs.createReadStream(path); | ||
onSocketError(this, function(){ | ||
stream.destroy(); | ||
}); | ||
onFinished(this, stream.destroy.bind(stream)); | ||
@@ -144,2 +141,2 @@ return path; | ||
if ('\\\\' == path.substring(0, 2)) return true; // Microsoft Azure absolute path | ||
} | ||
} |
@@ -5,3 +5,3 @@ { | ||
"repository": "koajs/send", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"keywords": [ | ||
@@ -24,3 +24,3 @@ "koa", | ||
"dependencies": { | ||
"on-socket-error": "~1.0.1", | ||
"finished": "~1.1.1", | ||
"debug": "*" | ||
@@ -27,0 +27,0 @@ }, |
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
4753
111
+ Addedfinished@~1.1.1
+ Addedfinished@1.1.4(transitive)
- Removedon-socket-error@~1.0.1
- Removedon-socket-error@1.0.1(transitive)