Base custom request options on defaults, and add basic tests for makeProxyRequestOptions

This commit is contained in:
Michael B. Gale
2026-07-22 06:43:21 +01:00
parent 0c76f63b6d
commit 909828cd53
3 changed files with 37 additions and 8 deletions

6
lib/entry-points.js generated
View File

@@ -145788,7 +145788,11 @@ function getRegistryProxy(action) {
return void 0;
}
function makeProxyRequestOptions(dispatcher) {
if (dispatcher === void 0) {
return githubUtils.defaults.request;
}
return {
...githubUtils.defaults.request,
fetch: (req, init2) => {
return (0, import_undici.fetch)(req, { ...init2, dispatcher });
}
@@ -145797,7 +145801,7 @@ function makeProxyRequestOptions(dispatcher) {
function createApiClientWithDetails(apiDetails, { allowExternal = false, proxy = void 0 } = {}) {
const auth2 = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth;
const retryingOctokit = githubUtils.GitHub.plugin(retry);
const requestOptions = proxy === void 0 ? githubUtils.defaults.request : makeProxyRequestOptions(proxy);
const requestOptions = makeProxyRequestOptions(proxy);
return new retryingOctokit(
githubUtils.getOctokitOptions(auth2, {
baseUrl: apiDetails.apiURL,