Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

retrying non-idempotent and non-safe requests is considered harmful #75

Closed
Morl99 opened this issue Oct 6, 2022 · 4 comments
Closed

Comments

@Morl99
Copy link

Morl99 commented Oct 6, 2022

Hello,

thanks for providing this handy fetch replacement.

I wanted to provide feedback based on our usage of the lib. We were recently surprised to discover, that fetch-retry also retries non-idempotent and non-safe http requests (see the http spec section 9.2). This can lead to unintended effects on the target server.

I would suggest, that by default, fetch-retry should only retry idempotent or safe methods as defined by the spec, and optionally provide a setting, so that all methods are retried. In order to avoid a breaking change, it would also be viable to leave the default as is, and explain in the docs, how the spec compliant behaviour can be setup.

I would be open to contribute if we can agree on a solution.

@Morl99
Copy link
Author

Morl99 commented Nov 9, 2022

@Ethan-Arrowood I wonder if you have noticed this issue and if this library is still maintained?

@Ethan-Arrowood
Copy link
Collaborator

Hi, we did not notice this previously. This library is still used, just not widely so it makes sense we missed it. Would be happy to accept your contribution if you'd like to fix it; otherwise we will keep track of this and fix it up when we prioritize this in the future

@gfortaine
Copy link

@Morl99 please find a spec compliant fetch-retry implementation for node : https://github.com/npm/make-fetch-happen#opts-retry

@Ethan-Arrowood
Copy link
Collaborator

Thank you for the report. We are archiving this project; you can read more details here: #83

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants