File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -696,6 +696,13 @@ describe('node-fetch', () => {
696
696
} ) ;
697
697
} ) ;
698
698
699
+ it ( 'should handle response with no status text' , ( ) => {
700
+ const url = `${ base } no-status-text` ;
701
+ return fetch ( url ) . then ( res => {
702
+ expect ( res . statusText ) . to . equal ( '' ) ;
703
+ } ) ;
704
+ } ) ;
705
+
699
706
it ( 'should handle no content response' , ( ) => {
700
707
const url = `${ base } no-content` ;
701
708
return fetch ( url ) . then ( res => {
Original file line number Diff line number Diff line change @@ -70,6 +70,10 @@ export default class TestServer {
70
70
res . end ( 'text' ) ;
71
71
}
72
72
73
+ if ( p === '/no-status-text' ) {
74
+ res . writeHead ( 200 , '' , { } ) . end ( ) ;
75
+ }
76
+
73
77
if ( p === '/options' ) {
74
78
res . statusCode = 200 ;
75
79
res . setHeader ( 'Allow' , 'GET, HEAD, OPTIONS' ) ;
You can’t perform that action at this time.
0 commit comments