-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
refactor(middleware/cors)!: Config, lists as list types. #2962
refactor(middleware/cors)!: Config, lists as list types. #2962
Conversation
Improve insecure config error text.
WalkthroughThe updates revolve around enhancing the CORS middleware in a Fiber application, introducing array-based configurations for flexibility, refining origin validation, and adding support for private network access headers. Changes
Possibly related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2962 +/- ##
==========================================
- Coverage 82.83% 82.78% -0.06%
==========================================
Files 116 116
Lines 8411 8409 -2
==========================================
- Hits 6967 6961 -6
- Misses 1106 1109 +3
- Partials 338 339 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
@sixcolors v3 is not released yet so it wouldnt be a breaking change |
Since when coderabbit approves PR's? 😂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one comment. This is a great improvement.
PR Description:
This PR improves the configuration handling for CORS middleware by ensuring that configuration options related to allowed origins, methods, headers, and exposed headers are consistently treated as lists. This change provides better clarity and flexibility when specifying multiple values for these options.
Changes Made:
AllowOrigins
), methods (AllowMethods
), headers (AllowHeaders
), and exposed headers (ExposeHeaders
) as lists of strings.Config
struct to use slice types ([]string
) for these configuration options, allowing multiple values to be specified.Notes for Review:
Please review the PR and provide feedback. Thank you!
Summary by CodeRabbit
Documentation
New Features
Refactor
Tests