You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add regex support for origin validation in CORS configuration (#159)
* Allow regexp on AllowOrigins
* Regexp AllowOrigins requires slashes at start and end
* Merge branch 'gin-contrib/master' into feature/regexp-origin-match
# Conflicts:
# config.go
# cors.go
* Optimization
* Add regexp origin tests
* Fix regexp allowed origin schema check
* refactor: refactor regular expression handling in schema validation
- Define a new `regexpBasedOrigin` variable for compiling the regular expression
- Replace inline regular expression compilation with the `regexpBasedOrigin` variable in `validateAllowedSchemas` function
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* refactor: simplify origin validation with precompiled regex
- Define `originRegex` as a precompiled regular expression
- Simplify origin validation logic using `originRegex`
- Remove redundant regular expression compilation and matching logic
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* refactor: refactor codebase for improved readability and maintainability
- Remove `exportloopref` linter from `.golangci.yml`
- Update regex pattern in `config.go` to use backticks instead of double quotes
- Refactor `validateOrigin` function for better readability by splitting a long line into two lines
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
---------
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: arizz96 <arizz96@gmail.com>
0 commit comments