Skip to content

fix: remove error when HTTP QUERY request has empty body - #6929

Merged
Eomm merged 1 commit into
fastify:mainfrom
LiviaMedeiros:query-allow-empty-body
Sep 27, 2026
Merged

Eomm merged 1 commit into
fastify:mainfrom
LiviaMedeiros:query-allow-empty-body

Conversation

@LiviaMedeiros

@LiviaMedeiros LiviaMedeiros commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

The FST_ERR_ROUTE_MISSING_CONTENT error doesn't seem to align with the spec.

Servers MUST fail the request if the Content-Type request field ([HTTP], Section 8.3) is missing or is inconsistent with the request content.

This part doesn't say anything about request body being empty.
Inconsistency between Content-Type and request body (i.e. if media type itself does not allow empty content) should be handled by content parser rather than here.

Checklist

@github-actions github-actions Bot added documentation Improvements or additions to documentation typescript TypeScript related labels Aug 9, 2026
Comment thread lib/handle-request.js Resolved
@climba03003

Copy link
Copy Markdown
Member

Valid point, we can let the Content-Type parser handle it.

climba03003
climba03003 previously approved these changes Aug 9, 2026
@climba03003 climba03003 added the backport 5.x Issue or pr that should be backported to Fastify v5 label Aug 11, 2026
@Tony133
Tony133 requested a review from a team September 26, 2026 17:23

@gurgunday gurgunday left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Eomm Eomm added the bugfix Issue or PR that should land as semver patch label Sep 27, 2026
@Eomm
Eomm merged commit bc25b74 into fastify:main Sep 27, 2026
34 checks passed
Tony133 added a commit that referenced this pull request Oct 12, 2026
…dy (#7060)

Backport bc25b74 from #6929.

---------

Signed-off-by: Gürgün Dayıoğlu <[email protected]>
Co-authored-by: Livia Medeiros <[email protected]>
Co-authored-by: Gürgün Dayıoğlu <[email protected]>
Co-authored-by: Antonio Tripodi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 5.x Issue or pr that should be backported to Fastify v5 bugfix Issue or PR that should land as semver patch documentation Improvements or additions to documentation typescript TypeScript related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants