Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
axios-retry-interceptor
Advanced tools
Configurable Axios Interceptor to retry failed http calls.
npm install --save axios-retry-interceptor
Import
import retryInterceptor from 'axios-retry-interceptor';
// or
const retryInterceptor = require('axios-retry-interceptor');
Set the interceptor for your axios instance. Voila! ✨
retryInterceptor(axios, {
maxAttempts: 3,
waitTime: 1000
});
Max number of times the interceptor should retry the failed http call.
Type: Number
Default: 3
Example: maxAttempts: 5
Duration between each retry attempt in milliseconds(1s=1000ms).
Type: Number
Default: 0
Example: waitTime: 3000
Response errorCodes for which the interceptor should retry.
Ideally any implementation should retry only 5xx status(server errors) and should not retry 4xx status(client errors). The reason is, if a http call fails with a client error, then the retry call will have the same headers/params and will obviously fail. So by default all 5xx errors will be retried. If you want to customize the status for which the retries should be made, use this config.
Type: Array
Default: []
Example: errorCodes: [500, 501, 401]
Ideally only idempotent http methods (GET, PUT, DELETE, HEAD, OPTIONS) should be retried on failed http calls. Non-idempotent methods like POST should NOT be retried and that's why this library will not permit retry of non-idempotent methods.
MIT © Dinesh Pandiyan
FAQs
Axios Interceptor to retry failed http calls
The npm package axios-retry-interceptor receives a total of 13 weekly downloads. As such, axios-retry-interceptor popularity was classified as not popular.
We found that axios-retry-interceptor demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.