@@ -9,11 +9,11 @@ function isResGzipped(res) {
99}
1010
1111function zipOrUnzip ( method ) {
12- return function ( rspData , res ) {
12+ return function ( rspData , res ) {
1313 return new Promise ( function ( resolve , reject ) {
1414 if ( isResGzipped ( res ) && rspData . length ) {
15- zlib [ method ] ( rspData , function ( err , buffer ) {
16- if ( err ) {
15+ zlib [ method ] ( rspData , function ( err , buffer ) {
16+ if ( err ) {
1717 reject ( err ) ;
1818 } else {
1919 resolve ( buffer ) ;
@@ -37,11 +37,11 @@ function verifyBuffer(rspd, reject) {
3737
3838function updateHeaders ( res , rspdBefore , rspdAfter , reject ) {
3939 if ( ! res . headersSent ) {
40- res . set ( 'content-length' , rspdAfter . length ) ;
40+ res . set ( 'content-length' , rspdAfter . length ) ;
4141 } else if ( rspdAfter . length !== rspdBefore . length ) {
42- var error = '"Content-Length" is already sent,' +
42+ var error = '"Content-Length" is already sent,' +
4343 'the length of response data can not be changed' ;
44- return reject ( new Error ( error ) ) ;
44+ return reject ( new Error ( error ) ) ;
4545 }
4646}
4747
@@ -56,27 +56,27 @@ function decorateProxyResBody(container) {
5656 var proxyRes = container . proxy . res ;
5757 var req = container . user . req ;
5858 var res = container . user . res ;
59- var originalResData ;
59+ var originalResData ;
6060
6161 if ( res . statusCode === 304 ) {
6262 debug ( 'Skipping userResDecorator on response 304' ) ;
6363 return Promise . resolve ( container ) ;
6464 }
6565
6666 return proxyResDataPromise
67- . then ( function ( proxyResData ) {
67+ . then ( function ( proxyResData ) {
6868 originalResData = proxyResData ;
6969 return resolverFn ( proxyRes , proxyResData , req , res ) ;
7070 } )
71- . then ( function ( modifiedResData ) {
72- return new Promise ( function ( resolve , reject ) {
71+ . then ( function ( modifiedResData ) {
72+ return new Promise ( function ( resolve , reject ) {
7373 var rspd = as . buffer ( modifiedResData , container . options ) ;
7474 verifyBuffer ( rspd , reject ) ;
7575 updateHeaders ( res , originalResData , rspd , reject ) ;
76- maybeZipPromise ( rspd , container . proxy . res ) . then ( function ( buffer ) {
76+ maybeZipPromise ( rspd , container . proxy . res ) . then ( function ( buffer ) {
7777 container . proxy . resData = buffer ;
7878 resolve ( container ) ;
79- } ) . catch ( function ( error ) {
79+ } ) . catch ( function ( error ) {
8080 reject ( error ) ;
8181 } ) ;
8282 } ) ;
0 commit comments