sourcefuse / loopback4-ratelimiter

A Rate Limiting Extension for Loopback 4 Applications
https://www.npmjs.com/package/loopback4-ratelimiter
MIT License
37 stars 10 forks source link

fix(chore): avoid setting config to null always #117

Closed shubhamp-sf closed 1 year ago

shubhamp-sf commented 1 year ago

Description

Existing code was unconditionally setting RateLimitSecurityBindings.CONFIG to null in the component constructor. Which is problematic for cases when this config is bound by user before adding the component.

This PR removes the need of setting config binding after the component is constructed by adding a condition that checks if the config options are already present.

GH-116

Fixes #116

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Checklist: