Skip to content

Strict content-type negotiation: only application/json accepted #43

Description

@usmanimamu17-create

Problem

Endpoints accept Content-Type: text/plain; Pydantic may silently parse.

Why

Loose content types enable param smuggling via alternate encodings.

Outcome

Middleware returns 415 for non-JSON/multipart. Multipart exempted.

Acceptance

  • POST with text/plain → 415
  • POST JSON works case-insensitively
  • Multipart unchanged

Files

  • app/middleware/content_type.py (NEW)
  • app/main.py

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programarea/apiREST API surface, OpenAPI, pagination, content-negotiation, error responsesarea/securitySecurity hardening, vulnerability fixes, threat surface reductionpriority/mediumStandard backlog item

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions