Skip to content

fix(servers): reject whitespace-only id, title and url in POST /servers/custom - #376

Merged
davidmckayv merged 1 commit into
CopilotKit:mainfrom
Ayush7614:fix/servers-custom-whitespace-validation
Sep 5, 2026
Merged

fix(servers): reject whitespace-only id, title and url in POST /servers/custom#376
davidmckayv merged 1 commit into
CopilotKit:mainfrom
Ayush7614:fix/servers-custom-whitespace-validation

Conversation

@Ayush7614

Copy link
Copy Markdown
Contributor

POST /servers/custom checked truthiness only, so id/title/url of ' ' passed validation and reached the store. The sibling oauth-client route in the same file already trims, so this aligns the two.

Change: require trimmed non-empty id/title/url (400 otherwise) and pass trimmed values to addCustomServer.

Verified: tsc clean; bun test server/tests/plugin-catalogue.test.ts 43 pass.

@davidmckayv davidmckayv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trims id/title/url in POST /servers/custom, matching the sibling oauth-client route. Read against live code + deep review: optional-chaining guards, trimmed values stored, grant-nothing. Composed build/tests green. CI approved.

@davidmckayv
davidmckayv merged commit 51e238c into CopilotKit:main Sep 5, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants