Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}

viceice marked this conversation as resolved.
Show resolved Hide resolved
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