-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for HTTP 304 status to work with Rails weak etags #142
Comments
According to JakeChampion/fetch#241, Chrome and Firefox should theortically convert the 304 into a 200. What browser and fetch implementation are you using? We should probably also expose the |
@ryanbrainard Oh, I see. I'm using this library in React Native that's the reason I'm facing this problem. |
I see, it would be best to fix it by using a |
@ryanbrainard did you ever configure the network request to correctly retrieve the cached body? Thanks! |
@objectiveSee No, sorry, I haven't. |
It's unclear whether you need to set the outgoing request's etag headers manually or not |
Since this is handled correctly in browsers, I think the easiest solution here is going to be to wrap https://github.com/heroku/react-refetch#on-changing-the-fetch-and-request-implementations I'm going to close this issue since there's not a change needed in this lib; however, if someone would like to update the readme with instructions or an example, I'd be happy to accept a PR. |
react-refetch
treats304
response from Rails 5 as200
and considers body as json. Whereas,304
doesn't return any body and so the whole thing breaks. Can we return previously returned200
response in case of304
status?The text was updated successfully, but these errors were encountered: