1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/common/request.ts
Roman 4270ec4240 tracker / user-store refactoring, part 1
Signed-off-by: Roman <ixrock@gmail.com>
2020-07-05 17:16:50 +03:00

12 lines
341 B
TypeScript

import request from "request"
import { userStore } from "./user-store"
export function globalRequestOpts(requestOpts: request.Options) {
const { httpsProxy, allowUntrustedCAs } = userStore.preferences
if (httpsProxy) {
requestOpts.proxy = httpsProxy
}
requestOpts.rejectUnauthorized = !allowUntrustedCAs;
return requestOpts
}