serve: follow-up improvements from PR #119 review #120

Closed
opened 2026-05-08 05:45:56 +00:00 by xingyue · 0 comments
Owner

Context

PR #119 review left 9 non-blocking suggestions. Track them here.

Tasks

Error Handling

  • Add global error handler (catch unhandled exceptions, return structured JSON)
  • JSON body parsing validation (malformed body should return 400, not 500)

Security

  • CORS: restrict origins (currently wide open with cors() defaults)
  • Add body size limit to POST endpoints

Performance

  • Reuse CAS store instance instead of creating per-request

Test Coverage

  • Error path tests (invalid JSON, missing fields)
  • CORS header assertions
  • Body limit behavior tests
  • Global error handler tests

Ref

Follow-up from #119, part of #118

## Context PR #119 review left 9 non-blocking suggestions. Track them here. ## Tasks ### Error Handling - [ ] Add global error handler (catch unhandled exceptions, return structured JSON) - [ ] JSON body parsing validation (malformed body should return 400, not 500) ### Security - [ ] CORS: restrict origins (currently wide open with `cors()` defaults) - [ ] Add body size limit to POST endpoints ### Performance - [ ] Reuse CAS store instance instead of creating per-request ### Test Coverage - [ ] Error path tests (invalid JSON, missing fields) - [ ] CORS header assertions - [ ] Body limit behavior tests - [ ] Global error handler tests ## Ref Follow-up from #119, part of #118
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#120