Comparing version 0.1.0-beta-66 to 0.1.0-beta-67
@@ -15,2 +15,3 @@ "use strict"; | ||
initalized: Type.BOOLEAN, | ||
isCompressionEnabled: Type.BOOLEAN, | ||
listenPort: Type.NUMBER, | ||
@@ -39,2 +40,3 @@ listenHost: Type.STRING, | ||
this.modelsPath = '@{appPath}/models/'; | ||
this.isCompressionEnabled = false; | ||
}, | ||
@@ -97,2 +99,5 @@ /** | ||
} | ||
if (Type.isBoolean(env.compression) && env.compression === true) { | ||
this.enableCompression(); | ||
} | ||
// set aliases | ||
@@ -187,3 +192,4 @@ if (Type.isArray(env.aliases)) { | ||
request: request, | ||
response: response | ||
response: response, | ||
isCompressionEnabled: this.isCompressionEnabled | ||
}, request.url); | ||
@@ -217,2 +223,13 @@ /// parse request | ||
* @author Igor Ivanovic | ||
* @method Bootstrap#enableCompression | ||
* | ||
* @description | ||
* Enable compression | ||
*/ | ||
enableCompression: function BootStrap_enableCompression() { | ||
this.isCompressionEnabled = true; | ||
}, | ||
/** | ||
* @since 0.0.1 | ||
* @author Igor Ivanovic | ||
* @method Bootstrap#setListenHost | ||
@@ -219,0 +236,0 @@ * |
@@ -45,2 +45,3 @@ "use strict"; | ||
isCompressed: Type.BOOLEAN, | ||
isCompressionEnabled: Type.BOOLEAN, | ||
encoding: Type.STRING, | ||
@@ -54,2 +55,3 @@ body: Type.OBJECT, | ||
this.isERROR = false; | ||
this.isCompressionEnabled = false; | ||
// body and isForwarded can be overriden | ||
@@ -508,3 +510,3 @@ core.extend(this, config); | ||
if (isForCompress) { | ||
if (isForCompress && !!this.isCompressionEnabled) { | ||
if (accept.indexOf('gzip') > -1) { | ||
@@ -511,0 +513,0 @@ this.addHeader('Content-Encoding', 'gzip'); |
@@ -5,3 +5,3 @@ { | ||
"description": "Powerful lightweight mvc framework for nodejs", | ||
"version": "0.1.0-beta-66", | ||
"version": "0.1.0-beta-67", | ||
"dependencies" : { | ||
@@ -8,0 +8,0 @@ "mongoose": "3.8.x", |
151783
4873