![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
axios-retry-after
Advanced tools
A tiny HTTP retry interceptor for axios.
This interceptor catches HTTP 429 errors, reads the Retry-After
header, and retries the request at the proper type.
With NPM:
npm install --save axios-retry-after
With Yarn:
yarn add axios-retry-after
import axios from 'axios'
import retry from 'axios-retry-after'
const client = axios.createClient()
client.interceptors.response.use(null, retry(client))
You can optionally customize the behavior of this interceptor by passing a second argument including one or more of the methods demonstrated below:
client.interceptors.response.use(null, retry(client, {
// Determine when we should attempt to retry
isRetryable (error) {
return (
error.response && error.response.status === 429 &&
// Use X-Retry-After rather than Retry-After, and cap retry delay at 60 seconds
error.response.headers['x-retry-after'] && error.response.headers['x-retry-after'] <= 60
)
}
// Customize the wait behavior
wait (error) {
return new Promise(
// Use X-Retry-After rather than Retry-After
resolve => setTimeout(resolve, error.response.headers['x-retry-after'])
)
}
// Customize the retry request itself
retry (axios, error) {
if (!error.config) {
throw error
}
// Apply request customizations before retrying
// ...
return axios(error.config)
}
}))
FAQs
A tiny HTTP 429 Retry-After interceptor for axios
The npm package axios-retry-after receives a total of 745 weekly downloads. As such, axios-retry-after popularity was classified as not popular.
We found that axios-retry-after demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.