Skip to content

Commit

Permalink
clone params-obj before modifying
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulGautamSingh committed Mar 22, 2023
1 parent 0bc8cb3 commit f45e152
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/modules/platform/index.spec.ts
Expand Up @@ -70,7 +70,6 @@ describe('modules/platform/index', () => {
{
hostType: 'bitbucket',
matchHost: 'api.bitbucket.org',
resolvedHost: 'api.bitbucket.org',
password: '123',
username: 'abc',
},
Expand Down
3 changes: 2 additions & 1 deletion lib/util/host-rules.ts
Expand Up @@ -9,7 +9,8 @@ import { parseUrl, validateUrl } from './url';

let hostRules: HostRule[] = [];

export function add(rule: HostRule): void {
export function add(params: HostRule): void {
const rule = clone(params);
const confidentialFields: (keyof HostRule)[] = ['password', 'token'];
if (rule.matchHost) {
const parsedUrl = parseUrl(rule.matchHost);
Expand Down

0 comments on commit f45e152

Please sign in to comment.