Repository navigation
fix(server): send an Allow header with 405 responses - #434
Merged
Merged
Conversation
anurag629
approved these changes
Oct 28, 2026
anurag629
left a comment
Member
There was a problem hiding this comment.
Thanks, this is right. Both 405 paths get the header, and it matches the preflight's methods. I merged it with current dev locally: build, typecheck, test:coverage, lint (same warnings as dev) and docs:check pass, and the three adapter tests fail with the two source lines reverted. Merging once CI is green on the updated branch.
Member
|
Merged, thanks @prakashNalla. It goes out with the next server release. |
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.
What does this change?
405 responses now include
Allow: POST, OPTIONS, the same methods the preflight sends inAccess-Control-Allow-Methods. Both paths are covered:fetchChatResponseinhttp.ts(Vercel, Cloudflare, and the session endpoint, which is routed after the method check) and the 405 branch in the Express adapter. The 405 row inprotocol.mdxmentions the header, and there's a patch changeset for@chatcops/server.Closes #431
How I tested this
The existing "returns 405" tests in
tests/adapters/vercel.test.ts,cloudflare.test.tsandexpress.test.tsnow also check theAllowheader. With the two source changes reverted, those 3 tests fail.pnpm -r buildandpnpm -r typecheck: passpnpm test: 129 files passed (5 skipped), 1748 tests passedpnpm test:coverage: passespnpm lint: passespnpm docs:check: 132 TypeScript blocks checkedAI assistance
Claude helped me w/ understand the issue
Checklist
devpnpm -r build,pnpm testandpnpm -r typecheckpass locallypnpm changeset) if this changescore,widgetorserver