Looks like this should be simple to implement and absolutely required for my use case, as I need to be able to pass an agent property to the fetch options but it seems like this is not currently allowed. Looking at the code all I need is to be able to add custom values to the init (type RequestInit) property (possibly through a core.config entry) and it should pass through.
|
const init: RequestInit = {}; |
|
if (this.config.timeout) { |
|
const controller = new AbortController(); |
|
timeoutSignal = setTimeout(() => controller.abort(), this.config.timeout); |
|
init.signal = controller.signal; |
|
} |
|
|
|
// `getHarForRequest` returns a partial HAR object, by way of `@readme/oas-to-har` but |
|
// `fetch-har` is typed to expect the full thing. Though we're supplying an incomplete HAR |
|
// object, at least the spec, our partial is fine. |
|
return fetchHar(har as unknown as Har, { files: data.files || {}, init, userAgent: this.userAgent }) |
Looks like this should be simple to implement and absolutely required for my use case, as I need to be able to pass an
agentproperty to the fetch options but it seems like this is not currently allowed. Looking at the code all I need is to be able to add custom values to the init (type RequestInit) property (possibly through a core.config entry) and it should pass through.api/packages/core/src/index.ts
Lines 100 to 110 in 685212b