
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@ckpack/fetch-helper
Advanced tools
fetch-helper
是对 fetch API的简单封装, 所以只支持在浏览器中使用,如果需要在node环境中使用,请添加fetch-node
依赖。
import fetch from 'node-fetch';
globalThis.fetch = fetch;
Promise fetch(input[, Fetchinit]);
fetch-helper
除了支持原生fetch的所有配置项参数还添加了以下参数
timeout
: timeout?: number
,超时时间(单位毫秒),默认不设置超时时间interceptors
: ``, 请求拦截器,该参数包含两个属性
request
: (fetchConfig: FetchConfig) => FetchConfig []
, 请求触发前触发,你可以用来修改请求参数response
: (response: Response, fetchConfig: FetchConfig) => unknown []
, 请求触发后触发,你可以用来修改返回结果如下面是一个获取修改headers
,并将返回结果转为json
的例子
const fetchHelper = FetchHelper(`some url`, {
interceptors: {
request: [(config) => {
config.headers = new Headers({
'Authorization': localStorage.getItem('token')
});
return config;
}],
response: [(response, config) => {
return response.json();
}]
}
});
异步返回一个 Response 对象。
你可以使用create
方法创建一个自定义配置的新实例。
const featch = FetchHelper.create({
interceptors: {
request: [(config) => {
config.headers = new Headers({
'Authorization': localStorage.getItem('token')
});
return config;
}],
response: [(response, config) => {
return response.json();
}]
}
});
featch(`some url`);
FAQs
We found that @ckpack/fetch-helper 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 researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.