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,15 +23,17 @@ const createJsonApiInjectable = getInjectable({
const lensProxyCert = di.inject(lensProxyCertificateInjectionToken);
return (config, reqInit) => {
config.getRequestOptions = async () => {
const agent = new Agent({
ca: lensProxyCert.get().cert,
});
return {
agent,
if (!config.getRequestOptions) {
config.getRequestOptions = async () => {
const agent = new Agent({
ca: lensProxyCert.get().cert,
});
return {
agent,
};
};
};
}
return new JsonApi(deps, config, reqInit);
};