mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2025-01-01 04:16:16 +01:00
enable rate limits for dev environment
This commit is contained in:
parent
9daafca155
commit
ead781900d
2 changed files with 2 additions and 2 deletions
|
@ -24,7 +24,7 @@ export class SkRateLimiterService {
|
||||||
@Inject(EnvService)
|
@Inject(EnvService)
|
||||||
envService: EnvService,
|
envService: EnvService,
|
||||||
) {
|
) {
|
||||||
this.disabled = envService.env.NODE_ENV !== 'production';
|
this.disabled = envService.env.NODE_ENV === 'test';
|
||||||
}
|
}
|
||||||
|
|
||||||
public async limit(limit: Keyed<RateLimit>, actor: string, factor = 1): Promise<LimitInfo> {
|
public async limit(limit: Keyed<RateLimit>, actor: string, factor = 1): Promise<LimitInfo> {
|
||||||
|
|
|
@ -120,7 +120,7 @@ describe(SkRateLimiterService, () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should bypass in non-production', async () => {
|
it('should bypass in test environment', async () => {
|
||||||
mockEnvironment.NODE_ENV = 'test';
|
mockEnvironment.NODE_ENV = 'test';
|
||||||
|
|
||||||
const info = await serviceUnderTest().limit({ key: 'l', type: undefined, max: 0 }, actor);
|
const info = await serviceUnderTest().limit({ key: 'l', type: undefined, max: 0 }, actor);
|
||||||
|
|
Loading…
Reference in a new issue