File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export default class Request extends Body {
5959 method = method . toUpperCase ( ) ;
6060
6161 // eslint-disable-next-line no-eq-null, eqeqeq
62- if ( ( ( init . body != null || isRequest ( input ) ) && input . body !== null ) &&
62+ if ( ( init . body != null || ( isRequest ( input ) && input . body !== null ) ) &&
6363 ( method === 'GET' || method === 'HEAD' ) ) {
6464 throw new TypeError ( 'Request with GET/HEAD method cannot have body' ) ;
6565 }
Original file line number Diff line number Diff line change @@ -123,6 +123,8 @@ describe('Request', () => {
123123 . to . throw ( TypeError ) ;
124124 expect ( ( ) => new Request ( base , { body : 'a' , method : 'head' } ) )
125125 . to . throw ( TypeError ) ;
126+ expect ( ( ) => new Request ( new Request ( base ) , { body : 'a' } ) )
127+ . to . throw ( TypeError ) ;
126128 } ) ;
127129
128130 it ( 'should throw error when including credentials' , ( ) => {
You can’t perform that action at this time.
0 commit comments