diff --git a/packages/repeater/README.md b/packages/repeater/README.md index 65a54cfb..5638fe3d 100644 --- a/packages/repeater/README.md +++ b/packages/repeater/README.md @@ -61,7 +61,7 @@ The default `requestRunnerOptions` is as follows: timeout: 30000, maxContentLength: 100, reuseConnection: false, - whitelistMimes: [ + allowedMimes: [ 'text/html', 'text/plain', 'text/css', @@ -87,7 +87,7 @@ export interface RequestRunnerOptions { timeout?: number; proxyUrl?: string; headers?: Record; - whitelistMimes?: string[]; + allowedMimes?: string[]; maxContentLength?: number; reuseConnection?: boolean; } diff --git a/packages/repeater/src/lib/RepeaterFactory.spec.ts b/packages/repeater/src/lib/RepeaterFactory.spec.ts index 42da7665..dac9b450 100644 --- a/packages/repeater/src/lib/RepeaterFactory.spec.ts +++ b/packages/repeater/src/lib/RepeaterFactory.spec.ts @@ -134,7 +134,7 @@ describe('RepeaterFactory', () => { const requestRunnerOptions = { timeout: 10000, maxContentLength: 200, - whitelistMimes: ['text/html'] + allowedMimes: ['text/html'] }; await factory.createRepeater({ @@ -169,7 +169,7 @@ describe('RepeaterFactory', () => { timeout: 30000, maxContentLength: 100, reuseConnection: false, - whitelistMimes: [ + allowedMimes: [ 'text/html', 'text/plain', 'text/css', diff --git a/packages/repeater/src/lib/RepeaterFactory.ts b/packages/repeater/src/lib/RepeaterFactory.ts index 69a2883b..b30bf5f4 100644 --- a/packages/repeater/src/lib/RepeaterFactory.ts +++ b/packages/repeater/src/lib/RepeaterFactory.ts @@ -16,7 +16,7 @@ export class RepeaterFactory { timeout: 30000, maxContentLength: 100, reuseConnection: false, - whitelistMimes: [ + allowedMimes: [ 'text/html', 'text/plain', 'text/css', diff --git a/packages/repeater/src/request-runner/RequestRunnerOptions.ts b/packages/repeater/src/request-runner/RequestRunnerOptions.ts index 27b8f770..3691629f 100644 --- a/packages/repeater/src/request-runner/RequestRunnerOptions.ts +++ b/packages/repeater/src/request-runner/RequestRunnerOptions.ts @@ -2,7 +2,7 @@ export interface RequestRunnerOptions { timeout?: number; proxyUrl?: string; headers?: Record; - whitelistMimes?: string[]; + allowedMimes?: string[]; maxContentLength?: number; reuseConnection?: boolean; } diff --git a/packages/repeater/src/request-runner/protocols/HttpRequestRunner.spec.ts b/packages/repeater/src/request-runner/protocols/HttpRequestRunner.spec.ts index c5c9365b..5ceab41c 100644 --- a/packages/repeater/src/request-runner/protocols/HttpRequestRunner.spec.ts +++ b/packages/repeater/src/request-runner/protocols/HttpRequestRunner.spec.ts @@ -121,10 +121,10 @@ describe('HttpRequestRunner', () => { expect(response.body).toEqual(bigBody.slice(0, 1024)); }); - it('should not truncate response body if it is in whitelisted mime types', async () => { + it('should not truncate response body if it is in allowed mime types', async () => { const runner = setupRunner({ maxContentLength: 1, - whitelistMimes: ['application/x-custom'] + allowedMimes: ['application/x-custom'] }); const { request, requestOptions } = createRequest(); const bigBody = 'x'.repeat(1025); @@ -137,10 +137,10 @@ describe('HttpRequestRunner', () => { expect(response.body).toEqual(bigBody); }); - it('should not truncate response body if whitelisted mime type starts with actual one', async () => { + it('should not truncate response body if allowed mime type starts with actual one', async () => { const runner = setupRunner({ maxContentLength: 1, - whitelistMimes: ['application/x-custom'] + allowedMimes: ['application/x-custom'] }); const { request, requestOptions } = createRequest(); const bigBody = 'x'.repeat(1025); diff --git a/packages/repeater/src/request-runner/protocols/HttpRequestRunner.ts b/packages/repeater/src/request-runner/protocols/HttpRequestRunner.ts index f1d58372..bf04b913 100644 --- a/packages/repeater/src/request-runner/protocols/HttpRequestRunner.ts +++ b/packages/repeater/src/request-runner/protocols/HttpRequestRunner.ts @@ -155,7 +155,7 @@ export class HttpRequestRunner implements RequestRunner { const type = this.parseContentType(res); const maxBodySize = this.maxContentLength * 1024; - const requiresTruncating = !this.options.whitelistMimes?.some( + const requiresTruncating = !this.options.allowedMimes?.some( (mime: string) => type.startsWith(mime) );