File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,10 @@ describe('webRequest module', () => {
2222 res . setHeader ( 'Location' , 'http://' + req . rawHeaders [ 1 ] ) ;
2323 res . end ( ) ;
2424 } else if ( req . url === '/contentDisposition' ) {
25- res . setHeader ( 'content-disposition' , [ ' attachment; filename=aa%E4%B8%ADaa.txt' ] ) ;
25+ res . writeHead ( 200 , [
26+ 'content-disposition' ,
27+ Buffer . from ( 'attachment; filename=aa中aa.txt' ) . toString ( 'binary' )
28+ ] ) ;
2629 const content = req . url ;
2730 res . end ( content ) ;
2831 } else {
@@ -478,7 +481,8 @@ describe('webRequest module', () => {
478481 callback ( { } ) ;
479482 } ) ;
480483 const { data, headers } = await ajax ( defaultURL + 'contentDisposition' ) ;
481- expect ( headers ) . to . to . have . property ( 'content-disposition' , 'attachment; filename=aa%E4%B8%ADaa.txt' ) ;
484+ const disposition = Buffer . from ( 'attachment; filename=aa中aa.txt' ) . toString ( 'binary' ) ;
485+ expect ( headers ) . to . to . have . property ( 'content-disposition' , disposition ) ;
482486 expect ( data ) . to . equal ( '/contentDisposition' ) ;
483487 } ) ;
484488
You can’t perform that action at this time.
0 commit comments