Skip to content

Return 400 if POST /api/v1/token has malformed body - #356

Merged
lstruman merged 1 commit into
developfrom
james-dev
Oct 2, 2026
Merged

lstruman merged 1 commit into
developfrom
james-dev

Conversation

@lstruman

@lstruman lstruman commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI balanced review requested due to automatic review settings October 2, 2026 18:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused correction matches the intended behavior, with updated test expectations and no identified issues.

Review effort: Balanced
Findings: None

What changed in this PR

Corrects POST /api/v1/token to return HTTP 400 instead of 500 when JSON decoding fails.

Changes:

  • Classifies malformed JSON as a client error.
  • Updates two existing tests to expect HTTP 400.
File Description
http/​webconfig_server_test.go Updates malformed-body status expectations.
http/​token_handler.go Returns HTTP 400 for JSON decoding errors.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@lstruman
lstruman merged commit 5592567 into develop Oct 2, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants