sindresorhus / ky

🌳 Tiny & elegant JavaScript HTTP client based on the Fetch API
MIT License
13.61k stars 364 forks source link

feat(retry): allow respecting Retry-After for user-defined status codes #598

Closed Kenneth-Sills closed 2 months ago

Kenneth-Sills commented 3 months ago

Implemented as recommended in related issue, with appropriate testing and documentation.

The included test is just a copy of the existing 413 one, but with a 500 and required config instead.

Closes #473.

sindresorhus commented 3 months ago

You also need to update https://github.com/sindresorhus/ky/blob/e044626ad8163f00a1fd3834558c1a13d5c2b2de/source/types/options.ts#L118-L142

Kenneth-Sills commented 3 months ago

Thanks for the review! I haven't had a lot of free time this past week, but I hope to get to this soon. Feel free to bump me if it gets stale, I do check notifications.