fix: pass allowed methods to CORS middleware - #670
Merged
nieblara merged 5 commits intoSep 16, 2026
Merged
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
Overview
Replaces the dev server’s single GET-only CORS middleware with
CorsHeadersForMethods, so each SDK route subrouter advertises the HTTP methods it actually supports (e.g. GET + REPORT on/evaland/sdk/evalx, GET on goals).Route registration now shares the same method list between mux routing and CORS
AllowedMethods, fixing preflight failures when browsers request non-GET methods like REPORT. Addscors_test.goto assert OPTIONS preflight allows configured methods and rejects others.Reviewed by Cursor Bugbot for commit 0f8f39d. Bugbot is set up for automated code reviews on this repo. Configure here.