vercel/fetch

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

Morl99 opened this issue · 4 comments

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.

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

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

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

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