File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,6 +123,9 @@ class HTTPTransport {
123123
124124 return this . fetch ( request . url , request . options )
125125 . then ( function ( response ) {
126+ if ( response . status === 204 ) {
127+ return
128+ }
126129 return parseResponse ( response , decoders , responseCallback )
127130 . then ( function ( data ) {
128131 if ( response . ok ) {
Original file line number Diff line number Diff line change @@ -302,4 +302,16 @@ describe('Test the HTTPTransport', function () {
302302 expect ( responseCallback ) . toHaveBeenCalledTimes ( 1 )
303303 } )
304304 } )
305+
306+ it ( 'should not throw on "204 no content"' , function ( ) {
307+ const url = 'http://www.example.com/'
308+ const link = new document . Link ( url , 'delete' )
309+ const transport = new transports . HTTPTransport ( {
310+ fetch : testUtils . mockedFetch ( null , null , 204 )
311+ } )
312+ const params = { }
313+
314+ return transport . action ( link , decoders , params )
315+ . catch ( error => expect ( error ) . toBeNull ( ) )
316+ } )
305317} )
You can’t perform that action at this time.
0 commit comments