Skip to content

[0.42-r2 M1] malformed form body (bad content-type) answers 500 instead of 400/415 #581

Description

@SisyphusZheng

Severity: medium · Category: protocol defect

Evidence (verified). curl -X POST /form -H 'content-type: application/json' -d '{}' → 500. c.req.raw.formData() throws on unparseable bodies and lands in the generic catch. A client error should be 400 (or 415), not a server-error page/log line.

Fix. Wrap the formData() call in the POST handler: parse failure → 400 with the framework status page (and ActionResult JSON on the fetch channel).

Acceptance. e2e asserts 400 for JSON content-type, and the JSON channel gets the error shape.


Filed from the 0.42 round-2 review (docs/audit/2026-07-28-alpha5-round2-review.md). Target line: 0.42.0-alpha.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.42.0-alpha.60.42 round-2 review remediation (morph client hardening)bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions