[wp-trac] [WordPress Trac] #46311: Image upload issues in Gutenberg with IIS

WordPress Trac noreply at wordpress.org
Thu Feb 27 13:13:22 UTC 2020


#46311: Image upload issues in Gutenberg with IIS
--------------------------+-----------------------------
 Reporter:  talldanwp     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+-----------------------------

Comment (by Otto42):

 The problem, by and large, is that older versions of IIS do some HTML work
 when they see things like the location header.

 The REST specification generally uses the 201 response with a location
 header to indicate that a new resource is created. This is the standard
 for such a response. You upload a file, server responds with 201-created
 and where the new resource is.

 References:

 https://tools.ietf.org/html/rfc7231#section-6.3.2
 https://restfulapi.net/http-status-201-created/

 IIS, especially older versions, sees a Location header, assumes it's for a
 redirect, and injects some HTML in the response for (extreme) backwards
 compatibility with older browsers that didn't follow redirects.

 Reference:

 https://stackoverflow.com/questions/12074730/w7-pro-iis-7-5-overwrites-
 php-location-header

 There's probably some ways to work around this with IIS that the
 stackoverflow topic doesn't cover, but the main ones are:

 - Don't use IIS, switch to Apache or nginx or something else.
 - Use a modern version of IIS, or possibly a hotfix that allows you to
 turn this off (https://support.microsoft.com/en-us/help/980363/a-hotfix-
 is-available-that-adds-features-to-the-fastcgi-module-in-iis) Note: Hotfix
 may no longer be available since all Microsoft resources tell you to
 switch to Windows 10 and more modern systems.

 And that's pretty much that, as far as my research can find. The short of
 it is that REST and the HAL specification has been around for long enough
 to be considered standard, so sending a 201 with a Location header is the
 correct practice for resource creation. If you're using a webserver older
 than that specification and which is still including backwards
 compatibility support that probably only applies to Netscape 1.0, then I
 would suggest upgrading to a webserver which has been updated since after
 2014.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46311#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list