File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,19 @@ describe('request', function () {
175175 . then ( done , done ) ;
176176 } ) ;
177177
178+ it ( 'agent can be used to set default headers' , function ( done ) {
179+ var agent = request . agent ( 'https://httpbin.org' ) ;
180+ agent . auth ( "user" , "passwd" ) ;
181+
182+ agent
183+ . get ( '/basic-auth/user/passwd' )
184+ . then ( function ( res ) {
185+ res . should . have . status ( 200 ) ;
186+ agent . close ( ) ;
187+ } )
188+ . then ( done , done ) ;
189+ } ) ;
190+
178191 it ( 'automatically closes the server down once done with it' , function ( done ) {
179192 var server = require ( 'http' ) . createServer ( function ( req , res ) {
180193 res . writeHeader ( 200 , { 'content-type' : 'text/plain' } ) ;
@@ -240,6 +253,6 @@ describe('request', function () {
240253 res . body . cookies . biz . should . equal ( 'baz' ) ;
241254 } )
242255 . then ( done , done ) ;
243- } ) ;
256+ } ) ;
244257 } ) ;
245258} ) ;
You can’t perform that action at this time.
0 commit comments