1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

don't override getRequestOptions if they are set

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2023-01-04 12:30:40 +02:00
parent b66592612a
commit b3a8ad362d

View File

@ -23,6 +23,7 @@ const createJsonApiInjectable = getInjectable({
const lensProxyCert = di.inject(lensProxyCertificateInjectionToken); const lensProxyCert = di.inject(lensProxyCertificateInjectionToken);
return (config, reqInit) => { return (config, reqInit) => {
if (!config.getRequestOptions) {
config.getRequestOptions = async () => { config.getRequestOptions = async () => {
const agent = new Agent({ const agent = new Agent({
ca: lensProxyCert.get().cert, ca: lensProxyCert.get().cert,
@ -32,6 +33,7 @@ const createJsonApiInjectable = getInjectable({
agent, agent,
}; };
}; };
}
return new JsonApi(deps, config, reqInit); return new JsonApi(deps, config, reqInit);
}; };