瀏覽代碼

Fixes typings for getProxyAgent

main
Eric Amodio 2 年之前
父節點
當前提交
2e68712353
共有 2 個文件被更改,包括 5 次插入4 次删除
  1. +3
    -2
      src/env/browser/fetch.ts
  2. +2
    -2
      src/plus/gitlab/gitlab.ts

+ 3
- 2
src/env/browser/fetch.ts 查看文件

@ -1,9 +1,10 @@
const fetch = globalThis.fetch;
export { fetch, fetch as insecureFetch };
import type { HttpsProxyAgent } from 'https-proxy-agent';
declare global {
interface RequestInit {
agent?: undefined;
agent?: HttpsProxyAgent | undefined;
}
}
@ -12,7 +13,7 @@ declare type _RequestInit = RequestInit;
declare type _Response = Response;
export type { _BodyInit as BodyInit, _RequestInit as RequestInit, _Response as Response };
export function getProxyAgent(_strictSSL?: boolean): undefined {
export function getProxyAgent(_strictSSL?: boolean): HttpsProxyAgent | undefined {
return undefined;
}

+ 2
- 2
src/plus/gitlab/gitlab.ts 查看文件

@ -682,7 +682,7 @@ $search: String!
rsp = await fetchMethod(`${baseUrl ?? 'https://gitlab.com/api'}/graphql`, {
method: 'POST',
headers: { authorization: `Bearer ${token}`, 'content-type': 'application/json' },
agent: agent as any,
agent: agent,
body: JSON.stringify({ query: query, variables: variables }),
});
@ -734,7 +734,7 @@ $search: String!
try {
rsp = await fetchMethod(url, {
headers: { authorization: `Bearer ${token}`, 'content-type': 'application/json' },
agent: agent as any,
agent: agent,
...options,
});

Loading…
取消
儲存