From c9f8acfd1ad7fa8ba11dd17d5863cdeca6609cfb Mon Sep 17 00:00:00 2001 From: Sebastian Poxhofer Date: Tue, 11 Jun 2024 22:47:53 +0200 Subject: [PATCH] feat(datasource/custom): remove content limiter for plain (#29549) --- .../datasource/custom/formats/plain.ts | 5 ---- lib/modules/datasource/custom/index.spec.ts | 24 ------------------- 2 files changed, 29 deletions(-) diff --git a/lib/modules/datasource/custom/formats/plain.ts b/lib/modules/datasource/custom/formats/plain.ts index 4b492b4063b7bb..6b16d4f0c77c3f 100644 --- a/lib/modules/datasource/custom/formats/plain.ts +++ b/lib/modules/datasource/custom/formats/plain.ts @@ -20,11 +20,6 @@ export class PlainFetcher implements CustomDatasourceFetcher { async fetch(http: Http, registryURL: string): Promise { const response = await http.getPlain(registryURL); - const contentType = response.headers['content-type']; - if (!contentType?.startsWith('text/')) { - return null; - } - return convertLinesToVersions(response.body); } diff --git a/lib/modules/datasource/custom/index.spec.ts b/lib/modules/datasource/custom/index.spec.ts index 10976ae507f7fb..5b997fa68990d4 100644 --- a/lib/modules/datasource/custom/index.spec.ts +++ b/lib/modules/datasource/custom/index.spec.ts @@ -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: [