111
try {
112
if (this._fetchFn) {
114
>
method: 'POST',
115
>
headers: {
116
>
'content-type': contentType,
117
>
'content-length': String(body.length),
118
>
...(this._options.headers ?? {}),
119
>
},
120
>
body: Uint8Array.from(body).buffer,
121
>
signal: AbortSignal.timeout(this._options.timeoutMs ?? 10_000),
122
>
});
123
>
await response.arrayBuffer();
124
>
if (!response.ok) {
125
throw new Error(`upstream returned HTTP ${response.status}`);
126
}
128
>
}
129
const url = new URL(this._resolvedEndpoint);
130
const isHttps = url.protocol === 'https:';