-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Ensure withRule always contains previous rules in the same chain (…
…#981) Fixes #972 When I originally wrote `withRule` in the arcjet core package, I always applied `rootRules` as the base rules. This meant that there was a bug where multiple calls to `withRule` would drop all rules except the rules on the root client and the most recent rule added with `withRule`. I've changed some internal logic to ensure we always use the previous rule set as the base rules before adding the new rule via `withRule`. Additionally, I've added functional tests to what were previously only type assertion tests to verify that the correct rules are being set inside the SDK.
- Loading branch information
1 parent
cd4621e
commit 2ee6581
Showing
2 changed files
with
105 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters