Skip to content

Commit

Permalink
feat(datasource/custom): remove content limiter for plain (#29549)
Browse files Browse the repository at this point in the history
  • Loading branch information
secustor committed Jun 11, 2024
1 parent 8975c9b commit c9f8acf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
5 changes: 0 additions & 5 deletions lib/modules/datasource/custom/formats/plain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
24 changes: 0 additions & 24 deletions lib/modules/datasource/custom/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down

0 comments on commit c9f8acf

Please sign in to comment.