[5.3] Set http status header for XML/feed responses#45419
[5.3] Set http status header for XML/feed responses#45419rdeutz merged 3 commits intojoomla:5.3-devfrom
Conversation
|
Not sure but is it not enough to add this single line in the function
|
|
well, yes, if we assume that
note: a similar check is not only implemented in JsonRenderer, but also in ErrorDocument joomla-cms/libraries/src/Document/ErrorDocument.php Lines 119 to 131 in 74e625d also in the joomla-framework/application documentation: However, this check is missing in other places. Also note, I am not an export in this (all of this just based on my code reviw of the last day), so I am not really sure what to decide here. |
|
The instanceof check is fine, but I think |
|
No, this should be equivalent in all typical cases. This very verbose code is just the same as already in the Json response, but I can certainly simplify the code. |
|
I have tested this item ✅ successfully on fbc2426 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45419. |
|
I have tested this item ✅ successfully on fbc2426 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45419. |
|
I have tested this item ✅ successfully on 8ab15d6 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45419. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45419. |
|
Thanks |
Pull Request for Issue #45398.
Summary of Changes
set the error code on the HTTP response
this is similar to the other error renderes (i.e. copied from https://github.com/joomla/joomla-cms/blob/5.3-dev/libraries/src/Error/Renderer/JsonRenderer.php)
Testing Instructions
set a menu item that shows an article as the home menu item
2, open
https://<your-site>/?format=feed-- of course, this is not a useful feed link (I know that; thats the whole point.see a response such as
Actual result BEFORE applying this Pull Request
the HTTP response status is 200
Expected result AFTER applying this Pull Request
the HTTP response status (not the one listed as
<code>404</code>) is actually 404Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed