fix: pass allowed methods to CORS middleware#670
Open
vissersg wants to merge 3 commits intolaunchdarkly:mainfrom
Open
fix: pass allowed methods to CORS middleware#670vissersg wants to merge 3 commits intolaunchdarkly:mainfrom
vissersg wants to merge 3 commits intolaunchdarkly:mainfrom
Conversation
nieblara
approved these changes
Mar 25, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Requirements
Related issues
#669
Describe the solution you've provided
When setting up the CORS middleware each router now passes in a list of methods that it supports, and the middleware handler uses that list to set
AllowedMethods. This replaces the hardcodedGETmethod to ensure all methods are properly handled.Describe alternatives you've considered
Provide a clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context about the pull request here.
Note
Low Risk
Low risk: small change to CORS middleware configuration for dev-server SDK routes, with added test coverage to ensure preflight behavior matches allowed methods.
Overview
Fixes CORS handling by replacing the hardcoded
GET-only middleware withCorsHeadersForMethods(...), so each SDK subrouter passes its own allowed methods (e.g.,GET+REPORT) intohandlers.AllowedMethods.Adds
cors_test.goto verify OPTIONS preflight requests succeed for configured methods and are rejected for disallowed methods.Written by Cursor Bugbot for commit 0122e07. This will update automatically on new commits. Configure here.