Changes between Initial Version and Version 1 of Ticket #37863, comment 4
- Timestamp:
- 08/30/2016 01:38:55 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #37863, comment 4
initial v1 1 Read my [original feedback to the support forum][https://wordpress.org/support/topic/wp-comments-postphp- 2 http-version] for which the originator of this bug report decided to create a ticket for. 1 Read my [https://wordpress.org/support/topic/wp-comments-postphp-http-version original feedback to the support forum] for which the originator of this bug report decided to create a ticket for. 3 2 4 3 The code above is wrong. … … 8 7 2) There is no future support in place with this code. The code above falls apart as newer HTTP versions come out (HTTP 2.01, HTTP 3, etc) which then results in returning HTTP 1.0 error messages. 9 8 10 3) Further, <a href="https://tools.ietf.org/html/rfc2145#section-2.3">RFC 2145 says</a>9 3) Further, [https://tools.ietf.org/html/rfc2145#section-2.3 RFC 2145 says]: 11 10 12 "An HTTP server SHOULD send a response version equal to the highest13 version for which the server is at least conditionally compliant, and14 whose major version is less than or equal to the one received in the15 request. An HTTP server MUST NOT send a version for which it is not16 at least conditionally compliant. A server MAY send a 505 (HTTP17 Version Not Supported) response if cannot send a response using the18 major version used in the client's request."11 "An HTTP server SHOULD send a response version equal to the highest 12 version for which the server is at least conditionally compliant, and 13 whose major version is less than or equal to the one received in the 14 request. An HTTP server MUST NOT send a version for which it is not 15 at least conditionally compliant. A server MAY send a 505 (HTTP 16 Version Not Supported) response if cannot send a response using the 17 major version used in the client's request." 19 18 20 You must trust what is returned in $_SERVER['SERVER_PROTOCOL'].21 19 You must trust what is returned in `$_SERVER['SERVER_PROTOCOL']`. 20 {{{ 22 21 <?php 23 22 if ('POST' != $_SERVER['REQUEST_METHOD']) { … … 28 27 } 29 28 ?> 30 29 }}} 31 30 If someone visits the post comment URL with different HTTP Methods (DELETE, GET, PUT, etc.) and you tell them you support HTTP 1.0, you are misleading them, especially if it is a service that now is going to think only HTTP 1.0 is the way to post comments.