File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -2137,7 +2137,7 @@ async function httpNetworkFetch (
2137
2137
2138
2138
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
2139
2139
if ( codings . length !== 0 && request . method !== 'HEAD' && request . method !== 'CONNECT' && ! nullBodyStatus . includes ( status ) && ! willFollow ) {
2140
- for ( let i = 0 ; i < codings . length ; ++ i ) {
2140
+ for ( let i = codings . length - 1 ; i >= 0 ; -- i ) {
2141
2141
const coding = codings [ i ]
2142
2142
// https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
2143
2143
if ( coding === 'x-gzip' || coding === 'gzip' ) {
Original file line number Diff line number Diff line change @@ -19,10 +19,10 @@ test('content-encoding header is case-iNsENsITIve', async (t) => {
19
19
res . setHeader ( 'Content-Encoding' , contentCodings )
20
20
res . setHeader ( 'Content-Type' , 'text/plain' )
21
21
22
- brotli . pipe ( gzip ) . pipe ( res )
22
+ gzip . pipe ( brotli ) . pipe ( res )
23
23
24
- brotli . write ( text )
25
- brotli . end ( )
24
+ gzip . write ( text )
25
+ gzip . end ( )
26
26
} ) . listen ( 0 )
27
27
28
28
t . after ( closeServerAsPromise ( server ) )
@@ -45,10 +45,10 @@ test('response decompression according to content-encoding should be handled in
45
45
res . setHeader ( 'Content-Encoding' , contentCodings )
46
46
res . setHeader ( 'Content-Type' , 'text/plain' )
47
47
48
- gzip . pipe ( deflate ) . pipe ( res )
48
+ deflate . pipe ( gzip ) . pipe ( res )
49
49
50
- gzip . write ( text )
51
- gzip . end ( )
50
+ deflate . write ( text )
51
+ deflate . end ( )
52
52
} ) . listen ( 0 )
53
53
54
54
t . after ( closeServerAsPromise ( server ) )
You can’t perform that action at this time.
0 commit comments