Skip to content

Commit

Permalink
refactor(http): Separate search and apply of host rules (#26067)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Dec 1, 2023
1 parent f42d058 commit 383bc11
Show file tree
Hide file tree
Showing 4 changed files with 308 additions and 188 deletions.
9 changes: 4 additions & 5 deletions lib/util/http/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import * as p from '../promises';
import { range } from '../range';
import { regEx } from '../regex';
import { joinUrlParts, parseLinkHeader, resolveBaseUrl } from '../url';
import { findMatchingRules } from './host-rules';
import { findMatchingRule } from './host-rules';
import type { GotLegacyError } from './legacy';
import type {
GraphqlOptions,
Expand Down Expand Up @@ -295,10 +295,9 @@ export class GithubHttp extends Http<GithubHttpOptions> {
);
}

const { token } = findMatchingRules(
{ hostType: this.hostType },
authUrl.toString(),
);
const { token } = findMatchingRule(authUrl.toString(), {
hostType: this.hostType,
});
opts.token = token;
}

Expand Down

0 comments on commit 383bc11

Please sign in to comment.