File tree 2 files changed +23
-2
lines changed
2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -148,8 +148,6 @@ app.defaultConfiguration = function defaultConfiguration() {
148
148
}
149
149
150
150
// inherit protos
151
- setPrototypeOf ( this . request , parent . request )
152
- setPrototypeOf ( this . response , parent . response )
153
151
setPrototypeOf ( this . engines , parent . engines )
154
152
setPrototypeOf ( this . settings , parent . settings )
155
153
} ) ;
Original file line number Diff line number Diff line change @@ -139,5 +139,28 @@ describe('app', function(){
139
139
. get ( '/sub/foo' )
140
140
. expect ( 200 , 'FOO' , cb )
141
141
} )
142
+
143
+ it ( 'should inherit parent app' , function ( done ) {
144
+ var app1 = express ( )
145
+ var app2 = express ( )
146
+ var cb = after ( 1 , done )
147
+
148
+ app2 . request . foo = 'bar' ;
149
+ app1 . response . shout = function ( str ) {
150
+ this . setHeader ( 'foo' , this . req . foo )
151
+ this . send ( str . toUpperCase ( ) )
152
+ }
153
+
154
+ app1 . use ( '/sub' , app2 )
155
+
156
+ app2 . get ( '/' , function ( req , res ) {
157
+ res . shout ( 'foo' )
158
+ } )
159
+
160
+ request ( app1 )
161
+ . get ( '/sub' )
162
+ . expect ( 'foo' , 'bar' )
163
+ . expect ( 200 , 'FOO' , cb )
164
+ } )
142
165
} )
143
166
} )
You can’t perform that action at this time.
0 commit comments