Make WordPress Core

Opened 7 years ago

Closed 13 months ago

#40323 closed defect (bug) (fixed)

wp-admin/async-upload.php returns "text/html" at Content-Type

Reported by: mrasu's profile mrasu Owned by:
Milestone: 5.3 Priority: normal
Severity: normal Version: 4.7.3
Component: Upload Keywords: close 2nd-opinion
Focuses: administration Cc:

Description

When uploading image via wp-admin/async-upload.php, response-header includes "text/html" at Content-Type.

I'm creating a module only for html.
So I want to detect the response is html or not.
But this response returns text/html at header, so I cannot detect correctly.
To handle properly, I want response-header to use "application/json" or something.

Change History (3)

#1 @dd32
7 years ago

  • Component changed from REST API to Upload
  • Focuses rest-api removed
  • Keywords close 2nd-opinion added

If I recall correctly, wp-admin/async-upload.php is forced to return text/html due to browser incompatibilities.

Upon digging, it affects IE9 and lower - [31429].

I don't think we should be changing this header quite yet, maybe in another year or so we might be in a place where we can.

#2 @SergeyBiryukov
5 years ago

#45327 was marked as a duplicate.

#3 @hellofromTonya
13 months ago

  • Milestone changed from Awaiting Review to 5.3
  • Resolution set to fixed
  • Status changed from new to closed

Hello @mrasu,

Changeset [45936] modified the Content-Type to text/plain in WP 5.3.0. As the request was to use something other than html, r45936 fixes this issue.

I'll close this ticket as fixed.

Note: See TracTickets for help on using tickets.