feat(datasource/custom): remove content limiter for plain (#29549)

This commit is contained in:
Sebastian Poxhofer 2024-06-11 22:47:53 +02:00 committed by GitHub
parent 8975c9bda6
commit c9f8acfd1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 29 deletions

View file

@ -20,11 +20,6 @@ export class PlainFetcher implements CustomDatasourceFetcher {
async fetch(http: Http, registryURL: string): Promise<unknown> {
const response = await http.getPlain(registryURL);
const contentType = response.headers['content-type'];
if (!contentType?.startsWith('text/')) {
return null;
}
return convertLinesToVersions(response.body);
}

View file

@ -209,30 +209,6 @@ describe('modules/datasource/custom/index', () => {
expect(result).toEqual(expected);
});
it('return null for plain text API if the body is not what is expected', async () => {
const expected = {
releases: [
{
version: '1.0.0',
},
],
};
httpMock.scope('https://example.com').get('/v1').reply(200, expected, {
'Content-Type': 'application/json',
});
const result = await getPkgReleases({
datasource: `${CustomDatasource.id}.foo`,
packageName: 'myPackage',
customDatasources: {
foo: {
defaultRegistryUrlTemplate: 'https://example.com/v1',
format: 'plain',
},
},
});
expect(result).toBeNull();
});
it('return releases for yaml API directly exposing in Renovate format', async () => {
const expected = {
releases: [