@@ -291,7 +291,7 @@ basePathConfigs.forEach(([basePath, testTitle]) => {
291
291
await request ( app )
292
292
. get ( basePath + "/foo" )
293
293
. expect ( ( res ) => {
294
- expect ( res . headers . location ) . to . equal ( "/foo/" ) ;
294
+ expect ( res . headers . location ) . to . equal ( basePath + "/foo/" ) ;
295
295
} )
296
296
. expect ( 301 ) ;
297
297
} ) ;
@@ -302,7 +302,9 @@ basePathConfigs.forEach(([basePath, testTitle]) => {
302
302
await request ( app )
303
303
. get ( basePath + "/foo?query=params" )
304
304
. expect ( ( req ) => {
305
- expect ( req . headers . location ) . to . equal ( "/foo/?query=params" ) ;
305
+ expect ( req . headers . location ) . to . equal (
306
+ basePath + "/foo/?query=params"
307
+ ) ;
306
308
} )
307
309
. expect ( 301 ) ;
308
310
} ) ;
@@ -314,7 +316,7 @@ basePathConfigs.forEach(([basePath, testTitle]) => {
314
316
await request ( app )
315
317
. get ( basePath + "/foo" )
316
318
. expect ( 301 )
317
- . expect ( "Location" , "/foo/" ) ;
319
+ . expect ( "Location" , basePath + "/foo/" ) ;
318
320
} ) ;
319
321
} ) ;
320
322
@@ -325,7 +327,7 @@ basePathConfigs.forEach(([basePath, testTitle]) => {
325
327
await request ( app )
326
328
. get ( basePath + "/foo/" )
327
329
. expect ( 301 )
328
- . expect ( "Location" , "/foo" ) ;
330
+ . expect ( "Location" , basePath + "/foo" ) ;
329
331
} ) ;
330
332
331
333
it ( "returns a 404 if a trailing slash was added to a valid path" , async ( ) => {
@@ -342,7 +344,7 @@ basePathConfigs.forEach(([basePath, testTitle]) => {
342
344
await request ( app )
343
345
. get ( basePath + "/foo/" )
344
346
. expect ( 301 )
345
- . expect ( "Location" , "/foo" ) ;
347
+ . expect ( "Location" , basePath + "/foo" ) ;
346
348
} ) ;
347
349
348
350
it ( "normalizes multiple leading slashes on a redirect" , async ( ) => {
@@ -351,7 +353,7 @@ basePathConfigs.forEach(([basePath, testTitle]) => {
351
353
await request ( app )
352
354
. get ( basePath + "/foo////" )
353
355
. expect ( 301 )
354
- . expect ( "Location" , "/foo" ) ;
356
+ . expect ( "Location" , basePath + "/foo" ) ;
355
357
} ) ;
356
358
} ) ;
357
359
0 commit comments