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.
fetch-intercept2
Advanced tools
Interceptor library for the native fetch command inspired by angular http intercepts.
Interceptor library for the native fetch command inspired by angular http interceptors.
fetch-intercept
monkey patches the global fetch
method and allows you the usage in Browser, Node and Webworker environments.
npm install fetch-intercept2 --save
Note: You need to require fetch-intercept
before you use fetch
the first time.
Make sure you have a fetch
compatible environment or added a appropriate polyfill.
import fetchIntercept from 'fetch-intercept2';
const unregister = fetchIntercept.register({
request: function (url, config) {
// Modify the url or config here
return [url, config];
},
requestError: function (error) {
// Called when an error occured during another 'request' interceptor call
return Promise.reject(error);
},
response: function (response) {
// Modify the reponse object
return response;
},
responseError: function (error) {
// Handle an fetch error
return Promise.reject(error);
}
});
// Call fetch to see your interceptors in action.
fetch('http://google.com');
// Unregister your interceptor
unregister();
Support react-native 0.17
or higher versions.
MIT
FAQs
Interceptor library for the native fetch command inspired by angular http intercepts.
We found that fetch-intercept2 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.