mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 23:16:26 +00:00
feat(datasource/custom): remove content limiter for plain (#29549)
This commit is contained in:
parent
8975c9bda6
commit
c9f8acfd1a
2 changed files with 0 additions and 29 deletions
|
@ -20,11 +20,6 @@ export class PlainFetcher implements CustomDatasourceFetcher {
|
||||||
async fetch(http: Http, registryURL: string): Promise<unknown> {
|
async fetch(http: Http, registryURL: string): Promise<unknown> {
|
||||||
const response = await http.getPlain(registryURL);
|
const response = await http.getPlain(registryURL);
|
||||||
|
|
||||||
const contentType = response.headers['content-type'];
|
|
||||||
if (!contentType?.startsWith('text/')) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return convertLinesToVersions(response.body);
|
return convertLinesToVersions(response.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -209,30 +209,6 @@ describe('modules/datasource/custom/index', () => {
|
||||||
expect(result).toEqual(expected);
|
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 () => {
|
it('return releases for yaml API directly exposing in Renovate format', async () => {
|
||||||
const expected = {
|
const expected = {
|
||||||
releases: [
|
releases: [
|
||||||
|
|
Loading…
Reference in a new issue