Skip to content
Snippets Groups Projects
Unverified Commit d554483f authored by Jonas's avatar Jonas Committed by GitHub
Browse files

fix(platform/gerrit): URI encode branch in gerrit's getFile() (#30753)

parent eccb4d57
No related branches found
No related tags found
No related merge requests found
......@@ -415,11 +415,11 @@ describe('modules/platform/gerrit/client', () => {
httpMock
.scope(gerritEndpointUrl)
.get(
'/a/projects/test%2Frepo/branches/main/files/renovate.json/content',
'/a/projects/test%2Frepo/branches/base%2Fbranch/files/renovate.json/content',
)
.reply(200, gerritFileResponse('{}'));
await expect(
client.getFile('test/repo', 'main', 'renovate.json'),
client.getFile('test/repo', 'base/branch', 'renovate.json'),
).resolves.toBe('{}');
});
});
......
......@@ -195,7 +195,7 @@ class GerritClient {
const base64Content = await this.gerritHttp.get(
`a/projects/${encodeURIComponent(
repo,
)}/branches/${branch}/files/${encodeURIComponent(fileName)}/content`,
)}/branches/${encodeURIComponent(branch)}/files/${encodeURIComponent(fileName)}/content`,
);
return Buffer.from(base64Content.body, 'base64').toString();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment