Comparing version 0.1.0-beta-21 to 0.1.0-beta-22
@@ -43,3 +43,4 @@ "use strict"; | ||
encoding: Type.STRING, | ||
body: Type.STRING | ||
body: Type.STRING, | ||
id: Type.STRING | ||
}, { | ||
@@ -59,3 +60,3 @@ _construct: function Request(config, url) { | ||
this.isRendered = false; | ||
this.id = this._uuid(); | ||
}, | ||
@@ -348,2 +349,16 @@ /** | ||
* @author Igor Ivanovic | ||
* @method Request#_uuid | ||
* | ||
* @description | ||
* Generate uuid | ||
*/ | ||
_uuid: function () { | ||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { | ||
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); | ||
return v.toString(16); | ||
}); | ||
}, | ||
/** | ||
* @since 0.0.1 | ||
* @author Igor Ivanovic | ||
* @method Request#_process | ||
@@ -431,9 +446,5 @@ * | ||
if (this.isRendered) { | ||
logger.print('Request.render: data are rendered', response); | ||
return false; | ||
} | ||
logger.print('Request.render', response); | ||
this._checkContentType('text/html'); | ||
@@ -455,2 +466,8 @@ | ||
if ((response instanceof Error) || this.isERROR || this.statusCode === 500) { | ||
logger.print('Request.error', this.statusCode, this.id, this.getHeader('content-type'), response); | ||
} else { | ||
logger.print('Request.render', this.statusCode, this.id, this.getHeader('content-type')); | ||
} | ||
this.isRendered = true; | ||
@@ -457,0 +474,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "Powerful lightweight mvc framework for nodejs", | ||
"version": "0.1.0-beta-21", | ||
"version": "0.1.0-beta-22", | ||
"dependencies" : { | ||
@@ -8,0 +8,0 @@ "mongoose": "3.8.x", |
113999
3639