mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
fix(bitbucket-server): revert encode auth in URL (#3511)
This reverts commit 3e66e019e4
.
This commit is contained in:
parent
107051e7cd
commit
ec16c8b2b8
2 changed files with 3 additions and 19 deletions
|
@ -124,9 +124,7 @@ async function initRepo({
|
|||
const { host, pathname } = url.parse(opts.endpoint);
|
||||
const gitUrl = GitStorage.getUrl({
|
||||
gitFs: gitFs || 'https',
|
||||
auth: `${encodeURIComponent(opts.username)}:${encodeURIComponent(
|
||||
opts.password
|
||||
)}`,
|
||||
auth: `${opts.username}:${opts.password}`,
|
||||
host: `${host}${pathname}${pathname.endsWith('/') ? '' : '/'}scm`,
|
||||
repository,
|
||||
});
|
||||
|
|
|
@ -33,7 +33,6 @@ describe('platform/bitbucket-server', () => {
|
|||
jest.spyOn(api, 'delete');
|
||||
bitbucket = require('../../../lib/platform/bitbucket-server');
|
||||
GitStorage = require('../../../lib/platform/git/storage');
|
||||
jest.spyOn(GitStorage, 'getUrl');
|
||||
GitStorage.mockImplementation(() => ({
|
||||
initRepo: jest.fn(),
|
||||
cleanRepo: jest.fn(),
|
||||
|
@ -59,8 +58,8 @@ describe('platform/bitbucket-server', () => {
|
|||
hostRules.update({
|
||||
platform: 'bitbucket-server',
|
||||
token: 'token',
|
||||
username: 'user@ame',
|
||||
password: 'passw:rd',
|
||||
username: 'username',
|
||||
password: 'password',
|
||||
endpoint: mockResponses.baseURL,
|
||||
});
|
||||
});
|
||||
|
@ -99,19 +98,6 @@ describe('platform/bitbucket-server', () => {
|
|||
expect(res).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('sends the username and password encoded', async () => {
|
||||
expect.assertions(2);
|
||||
GitStorage.getUrl.mockClear();
|
||||
await bitbucket.initRepo({
|
||||
repository: 'SOME/repo',
|
||||
});
|
||||
expect(GitStorage.getUrl).toHaveBeenCalledTimes(1);
|
||||
expect(GitStorage.getUrl.mock.calls[0][0]).toHaveProperty(
|
||||
'auth',
|
||||
'user%40ame:passw%3Ard'
|
||||
);
|
||||
});
|
||||
|
||||
it('sends the host as the endpoint option', async () => {
|
||||
expect.assertions(2);
|
||||
GitStorage.getUrl.mockClear();
|
||||
|
|
Loading…
Reference in a new issue