Make WordPress Core

Opened 7 months ago

Closed 7 months ago

Last modified 7 months ago

#61812 closed defect (bug) (reported-upstream)

wrong content type in error response on api.wordpress.org

Reported by: hadmut's profile hadmut Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: WordPress.org Site Keywords:
Focuses: Cc:

Description

curl -D /dev/stdout https://api.wordpress.org/plugins/update-check/1.1/

produces – of course – an error message, because the api call is wrong.

But it's header says

Content-Type: application/json; charset=utf-8

while the body is just

error

which is not json and thus breaks REST Clients. Either return json, or do not claim the content type is json.

Change History (2)

#1 @jorbin
7 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

Hi @hadmut, Welcome to WordPress Core Trac. This trac instance is for things that are a part of the WordPress core software. The issue you are reporting is one related to WordPress.org and so I've opened https://meta.trac.wordpress.org/ticket/7735 for you so the appropriate team can see it.

#2 @hadmut
7 months ago

BTW,

it should not reply with a 200 code and then spit out "error". If it is an error, use an error code. And maybe be somewhat talkative about the nature of the error.

Note: See TracTickets for help on using tickets.