redux-crud-store icon indicating copy to clipboard operation
redux-crud-store copied to clipboard

Fix: 204 No Content bug

Open dzwiedziu-nkg opened this issue 7 years ago • 3 comments

Fix of "Unexpected end of JSON input" when HTTP response is 204 No Content

dzwiedziu-nkg avatar Apr 20 '17 21:04 dzwiedziu-nkg

for example, someone might be manually checking the text() value of the response if the status is 204 (this is something I've done before). That would then fail if we pushed this change

devvmh avatar Apr 24 '17 21:04 devvmh

How about something more like

   // fix of "Unexpected end of JSON input" when HTTP response is 204 No Content
    if (response.status === 204) {
      return {
        ...response,
        [format]: () => null,
      };
    }

This way we're not losing any methods

tryangul avatar Jun 28 '17 18:06 tryangul

@dzwiedziu-nkg have you gotten a chance to look at this PR again?

devvmh avatar Aug 07 '17 15:08 devvmh