@@ -228,7 +228,7 @@ function Framework() {
228228
229229 this . id = null ;
230230 this . version = 1900 ;
231- this . version_header = '1.9.0-18 ' ;
231+ this . version_header = '1.9.0-19 ' ;
232232
233233 var version = process . version . toString ( ) . replace ( 'v' , '' ) . replace ( / \. / g, '' ) ;
234234 if ( version [ 1 ] === '0' )
@@ -5239,7 +5239,7 @@ Framework.prototype.listener = function(req, res) {
52395239 }
52405240 }
52415241
5242- req . uri = parser . parse ( protocol + '://' + req . host + req . url ) ;
5242+ req . uri = framework_internal . parseURI ( protocol , req . host , req . url ) ;
52435243 req . path = framework_internal . routeSplit ( req . uri . pathname ) ;
52445244 req . body = { } ;
52455245 req . files = new Array ( 0 ) ;
@@ -5251,16 +5251,12 @@ Framework.prototype.listener = function(req, res) {
52515251 res . success = false ;
52525252 res . setHeader ( 'X-Powered-By' , 'total.js v' + self . version_header ) ;
52535253
5254- if ( framework . _request_check_mobile )
5255- req . mobile = REG_MOBILE . test ( req . headers [ 'user-agent' ] ) ;
5256-
52575254 if ( self . isDebug )
52585255 res . setHeader ( 'Mode' , 'debug' ) ;
52595256
5260- req . isStaticFile = framework . config [ 'allow-handle-static-files' ] ? utils . isStaticFile ( req . uri . pathname ) : false ;
5257+ req . isStaticFile = framework . config [ 'allow-handle-static-files' ] ? framework_utils . isStaticFile ( req . uri . pathname ) : false ;
52615258
52625259 var can = true ;
5263-
52645260 if ( req . isStaticFile ) {
52655261 req . extension = path . extname ( req . uri . pathname ) . substring ( 1 ) ;
52665262 switch ( req . extension ) {
@@ -5284,6 +5280,9 @@ Framework.prototype.listener = function(req, res) {
52845280 if ( self . _length_request_middleware === 0 )
52855281 return self . _request_continue ( req , res , headers , protocol ) ;
52865282
5283+ if ( ! req . can ( 'disable-middleware' ) )
5284+ return self . _request_continue ( req , res , headers , protocol ) ;
5285+
52875286 var func = new Array ( self . _length_request_middleware ) ;
52885287 var indexer = 0 ;
52895288
@@ -5523,7 +5522,7 @@ Framework.prototype._upgrade = function(req, socket, head) {
55235522 }
55245523 }
55255524
5526- req . uri = parser . parse ( ( req . connection . encrypted || headers [ 'x-forwarded-protocol' ] === 'https' || headers [ 'x-forwarded-protocol' ] === 'wss' ? 'wss' : 'ws' ) + '://' + req . headers . host + req . url ) ;
5525+ req . uri = framework_internal . parseURI ( ( req . connection . encrypted || headers [ 'x-forwarded-protocol' ] === 'https' || headers [ 'x-forwarded-protocol' ] === 'wss' ? 'wss' : 'ws' ) , req . headers . host , req . url ) ;
55275526 req . session = null ;
55285527 req . user = null ;
55295528 req . flags = [ req . isSecure ? 'https' : 'http' , 'get' ] ;
@@ -5540,6 +5539,9 @@ Framework.prototype._upgrade = function(req, socket, head) {
55405539 if ( self . _length_request_middleware === 0 )
55415540 return self . _upgrade_prepare ( req , path , headers ) ;
55425541
5542+ if ( ! req . can ( 'disable-middleware' ) )
5543+ return self . _request_continue ( req , res , headers , protocol ) ;
5544+
55435545 var func = new Array ( self . _length_request_middleware ) ;
55445546 var indexer = 0 ;
55455547
@@ -6068,7 +6070,6 @@ Framework.prototype.testing = function(stop, callback) {
60686070 } ;
60696071
60706072 var options = parser . parse ( ( test . url . indexOf ( 'http://' ) > 0 || test . url . indexOf ( 'https://' ) > 0 ? '' : 'http://' + self . ip + ':' + self . port ) + test . url ) ;
6071-
60726073 if ( typeof ( test . data ) === TYPE_FUNCTION )
60736074 test . data = test . data ( ) ;
60746075
@@ -8656,6 +8657,11 @@ Subscribe.prototype.doEndfile = function() {
86568657 var req = self . req ;
86578658 var res = self . res ;
86588659
8660+ if ( ! framework . _length_files ) {
8661+ framework . responseStatic ( self . req , self . res ) ;
8662+ return ;
8663+ }
8664+
86598665 for ( var i = 0 ; i < framework . _length_files ; i ++ ) {
86608666 var file = framework . routes . files [ i ] ;
86618667 try {
@@ -13477,6 +13483,12 @@ http.IncomingMessage.prototype = {
1347713483 return this . $language ;
1347813484 } ,
1347913485
13486+ get mobile ( ) {
13487+ if ( this . $mobile === undefined )
13488+ this . $mobile = REG_MOBILE . test ( this . headers [ 'user-agent' ] ) ;
13489+ return this . $mobile ;
13490+ } ,
13491+
1348013492 set language ( value ) {
1348113493 this . $language = value ;
1348213494 }
0 commit comments