1
1
var http = require ( 'http' ) ,
2
2
https = require ( 'https' ) ,
3
3
web_o = require ( './web-outgoing' ) ,
4
- common = require ( '../common' ) ,
5
- passes = exports ;
4
+ common = require ( '../common' ) ;
6
5
7
6
web_o = Object . keys ( web_o ) . map ( function ( pass ) {
8
7
return web_o [ pass ] ;
@@ -16,7 +15,8 @@ web_o = Object.keys(web_o).map(function(pass) {
16
15
* flexible.
17
16
*/
18
17
19
- [ // <--
18
+
19
+ module . exports = {
20
20
21
21
/**
22
22
* Sets `content-length` to '0' if request is of DELETE type.
@@ -28,7 +28,7 @@ web_o = Object.keys(web_o).map(function(pass) {
28
28
* @api private
29
29
*/
30
30
31
- function deleteLength ( req , res , options ) {
31
+ deleteLength : function ( req , res , options ) {
32
32
if ( ( req . method === 'DELETE' || req . method === 'OPTIONS' )
33
33
&& ! req . headers [ 'content-length' ] ) {
34
34
req . headers [ 'content-length' ] = '0' ;
@@ -46,7 +46,7 @@ web_o = Object.keys(web_o).map(function(pass) {
46
46
* @api private
47
47
*/
48
48
49
- function timeout ( req , res , options ) {
49
+ timeout : function ( req , res , options ) {
50
50
if ( options . timeout ) {
51
51
req . socket . setTimeout ( options . timeout ) ;
52
52
}
@@ -62,7 +62,7 @@ web_o = Object.keys(web_o).map(function(pass) {
62
62
* @api private
63
63
*/
64
64
65
- function XHeaders ( req , res , options ) {
65
+ XHeaders : function ( req , res , options ) {
66
66
if ( ! options . xfwd ) return ;
67
67
68
68
var encrypted = req . isSpdy || common . hasEncryptedConnection ( req ) ;
@@ -94,7 +94,7 @@ web_o = Object.keys(web_o).map(function(pass) {
94
94
* @api private
95
95
*/
96
96
97
- function stream ( req , res , options , _ , server , clb ) {
97
+ stream : function ( req , res , options , _ , server , clb ) {
98
98
99
99
// And we begin!
100
100
server . emit ( 'start' , req , res , options . target )
@@ -168,7 +168,4 @@ web_o = Object.keys(web_o).map(function(pass) {
168
168
//proxyReq.end();
169
169
}
170
170
171
- ] // <--
172
- . forEach ( function ( func ) {
173
- passes [ func . name ] = func ;
174
- } ) ;
171
+ } ;
0 commit comments