Skip to content

No Content-Type Header Crashes Request #246

@thehabes

Description

@thehabes

JSON body with no Content-Type header will do it.

Load Test Evidence (Run 4, Phase 8 — Fuzzing)

From k6 Phase 8e (header manipulation):

  • POST /v1/api/create with valid JSON body but no Content-Type header at all → 500
  • k6 logged EOF error (connection closed unexpectedly), similar to Connection reset on bad headers #248

This and #245 likely share the same root cause: Express's express.json() middleware throws an unhandled error when it can't parse the body due to Content-Type mismatch/absence. A middleware guard before express.json() checking Content-Type would fix both.

Expected: 400 Bad Request or 415 Unsupported Media Type.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions