Comparing version 0.2.4 to 0.2.5
@@ -45,3 +45,4 @@ | ||
.getter('lastModified') | ||
.getter('etag'); | ||
.getter('etag') | ||
.getter('contentType'); | ||
@@ -48,0 +49,0 @@ /** |
@@ -108,3 +108,3 @@ | ||
if(ctx.next().value === ctx.REQ){ | ||
self.requestmw.callback( ctx => self.emit("request",ctx) , err => {self.emit('error.middleware',err); })(ctx); | ||
self.requestmw.callback( ctx => self.emit("request",ctx) , err => {ctx.done(); self.emit('error.middleware',err); })(ctx); | ||
}else{ | ||
@@ -111,0 +111,0 @@ throw new Error("context status error!"); |
@@ -26,3 +26,3 @@ | ||
get header() { | ||
return this.req.headers; | ||
return this.headers; | ||
}, | ||
@@ -320,9 +320,8 @@ | ||
get(field) { | ||
const req = this.req; | ||
switch (field = field.toLowerCase()) { | ||
case 'referer': | ||
case 'referrer': | ||
return req.headers.referrer || req.headers.referer || ''; | ||
return this.headers.referrer || this.headers.referer || ''; | ||
default: | ||
return req.headers[field] || ''; | ||
return this.headers[field] || ''; | ||
} | ||
@@ -329,0 +328,0 @@ }, |
@@ -145,3 +145,3 @@ | ||
get type() { | ||
const type = this.get('Content-Type'); | ||
const type = this.contentType; | ||
if (!type) return ''; | ||
@@ -152,2 +152,12 @@ return type.split(';')[0]; | ||
/** | ||
* Return the Content-Type String of header | ||
* | ||
* @return {String} | ||
* @api public | ||
*/ | ||
get contentType() { | ||
return this.get('Content-Type'); | ||
}, | ||
/** | ||
* Check whether the response is one of the listed types. | ||
@@ -154,0 +164,0 @@ * Pretty much the same as `this.request.is()`. |
@@ -114,2 +114,11 @@ | ||
process.on('SIGINT', function(){//ctrl+c | ||
functionsIn(this.app).forEach(function(fnKey){//bind functions | ||
w.removeFunction(appname+"_"+fnKey); | ||
}); | ||
w.close(); | ||
process.exit(0); | ||
}); | ||
this.initializeScheduler(this.config.schedule); | ||
@@ -116,0 +125,0 @@ this.on("request", this._send.bind(this) ) |
{ | ||
"name": "floodesh", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Floodesh is a distributed web spider/crawler written with Nodejs.", | ||
@@ -30,2 +30,3 @@ "bin":"./bin/floodesh", | ||
"bottleneckp": "^1.0.0", | ||
"delegates":"^1.0.0", | ||
"commander": "^2.9.0", | ||
@@ -32,0 +33,0 @@ "content-type": "^1.0.1", |
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
35333
1305
12
+ Addeddelegates@^1.0.0