Skip to content

fix(web): reject invalid backtest JSON bodies - #27

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
rissrice2105-agent:fix/backtest-json-body-validation
Jul 31, 2026
Merged

fix(web): reject invalid backtest JSON bodies#27
ralyodio merged 1 commit into
profullstack:masterfrom
rissrice2105-agent:fix/backtest-json-body-validation

Conversation

@rissrice2105-agent

Copy link
Copy Markdown
Contributor

Summary

  • reject malformed and non-object JSON bodies before reading backtest options
  • return HTTP 400 for valid null bodies instead of throwing a TypeError
  • prevent malformed JSON from falling through to a potentially expensive default backtest

Tests

  • vitest run src/app/api/backtest/route.test.ts (15 passed)
  • full @b1dz/web Vitest suite (96 passed)
  • tsc --noEmit

Closes #26

@ralyodio
ralyodio merged commit 8d03b5a into profullstack:master Jul 31, 2026
6 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.

Backtest API crashes on null JSON bodies

2 participants