Conversation
respond() unconditionally echoed the response body regardless of
status code. Per RFC 9110 §15.3.5 (204 No Content) and §15.4.5 (304
Not Modified), neither response may include a message body.
Confirmed via a real Joomla CMS API DELETE: PHP's built-in dev server
plus a strict HTTP/1.1 client (Playwright's Node HTTP client) fails to
parse the response at all ("Parse Error: Data after `Connection:
close`"), because a 204 is carrying a non-empty JSON:API body. Apache
is more lenient about the extra bytes, which is likely why this has
gone unnoticed.
Also skips the Content-Type header specifically for 204, since a 204
has no representation to describe. 304 keeps it deliberately -- per
RFC 9110 §15.4.5 a 304 is expected to carry the same representation
metadata headers the 200 it validates would have sent; only the body
is withheld.
Reported at joomla/joomla-cms#48553, traced
upstream to this package per @brianteeman's comment there.
This was referenced Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
respond()unconditionally echoes the response body regardless of status code. Per RFC 9110 §15.3.5 (204 No Content) and §15.4.5 (304 Not Modified), neither response may include a message body.Also skips the
Content-Typeheader specifically for 204, since a 204 has no representation to describe. 304 deliberately keeps it -- per §15.4.5 a 304 is expected to carry the same representation metadata headers the 200 it validates would have sent; only the body is withheld.Found via
A real Joomla CMS API
DELETE: PHP's built-in dev server plus a strict HTTP/1.1 client (Playwright's Node HTTP client) fails to parse the response at all (Parse Error: Data after \Connection: close``), because the 204 carries a non-empty JSON:API body. Apache is more lenient about the extra bytes, which is likely why this has gone unnoticed in practice.Reported at joomla/joomla-cms#48553, traced to this package per @brianteeman's comment there.
Testing
Two new tests added, mirroring the existing
testRespond()/testRespondWithAllowedCaching()pattern: one asserting no body and no Content-Type for 204, one asserting no body but Content-Type preserved for 304. Full existing suite still passes.Companion PR
Same fix on
3.x-dev, since Joomla 5 still pinsjoomla/application^3.0: #156