-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 'isRequestOriginAllowed' returns mixed results when regex is used (
#152) The 'isRequestOriginAllowed' function returned random results for global regexes, since the .test function was used, and the output of this function depends on previous invocations of the function. By resetting the 'lastIndex', every invocation of the function should now return the same result. This also updates the corresponding test to use a global regex, and do the same validation twice, in order to check consistency fixes #151 Co-authored-by: Tom Brouwer <brouwer@floodtags.com>
- Loading branch information
1 parent
2d6c272
commit dc7ad95
Showing
2 changed files
with
21 additions
and
15 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