Describe the Bug
API endpoints don't validate Content-Type header. Accepting form-data or plain text as JSON causes confusing parser errors.
Steps to Reproduce
- POST to /api/payments with Content-Type: text/plain
- Send JSON body
- Get 500 error: "Unexpected token in JSON"
- No clear indication of Content-Type mismatch
Expected Behavior
Validate Content-Type header, return 415 Unsupported Media Type with clear message.
Actual Behavior
Cryptic JSON parsing errors.
Environment
| Field |
Value |
| Component |
backend / api |
| OS |
Ubuntu 22.04 |
| Network |
testnet |
Describe the Bug
API endpoints don't validate Content-Type header. Accepting form-data or plain text as JSON causes confusing parser errors.
Steps to Reproduce
Expected Behavior
Validate Content-Type header, return 415 Unsupported Media Type with clear message.
Actual Behavior
Cryptic JSON parsing errors.
Environment