New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cors allow regex pattern #1623
cors allow regex pattern #1623
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1623 +/- ##
==========================================
+ Coverage 85.08% 85.20% +0.12%
==========================================
Files 28 28
Lines 2185 2203 +18
==========================================
+ Hits 1859 1877 +18
Misses 212 212
Partials 114 114
Continue to review full report at Codecov.
|
enable cors to use regex pattern for allowed origins implementation is similar to another popular cors middleware: https://github.com/astaxie/beego/blob/master/plugins/cors/cors.go#L196-L201
Looking good.
A small performance penalty is expected for CORS checks due to the regex matching used.
Tests available to check for plaintext and regex matches.
|
@KlotzAndrew Thanks for your contribution! |
enable cors to use regex pattern for allowed origins
implementation is similar to another popular cors middleware: https://github.com/astaxie/beego/blob/master/plugins/cors/cors.go#L196-L201