Pending

User tests: Successful: Unsuccessful:

avatar AkameOuO
AkameOuO
18 Mar 2025

Pull Request for Issue # .

Summary of Changes

Call sendHeaders after headers are set.
And set status code with application instead of using http_response_code.

Testing Instructions

  • Open media manager.
  • Open browser devtools and watch response headers related to com_media api.

Actual result BEFORE applying this Pull Request

Content type is incorrect text/html.
image

Expected result AFTER applying this Pull Request

Content type is correct application/json, and other headers are also set.
image

Link 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

avatar AkameOuO AkameOuO - open - 18 Mar 2025
avatar AkameOuO AkameOuO - change - 18 Mar 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Mar 2025
Category Administration com_media
avatar AkameOuO AkameOuO - change - 27 Mar 2025
Title
[5.2] Fix headers are not sent correctly in com_media api controller
[5.3] Fix headers are not sent correctly in com_media api controller
avatar AkameOuO AkameOuO - edited - 27 Mar 2025
avatar ceford ceford - test_item - 28 May 2025 - Tested successfully
avatar ceford
ceford - comment - 28 May 2025

I have tested this item ✅ successfully on e49301b

It took me a while to figure out exactly what to do: my browser URL

http://localhost/jcms-testing/administrator/index.php?option=com_media&format=json&mediatypes=0,1,2,3&task=api.files&path=local-images%3A%2Fpowered_by.png

Without the patch I could see Content Type: text/html and the visible response was just text but obviously json. With the patch the response was application/json and the browser nicely formatted the json for me.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45150.

Add a Comment

Login with GitHub to post a comment