Skip to content
Snippets Groups Projects
Unverified Commit c9f8acfd authored by Sebastian Poxhofer's avatar Sebastian Poxhofer Committed by GitHub
Browse files

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

parent 8975c9bd
No related merge requests found
......@@ -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);
}
......
......@@ -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: [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment