Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#13940 closed defect (bug) (invalid)

get_status_header_desc() returns HTTP 1.1 status codes for HTTP 1.0

Reported by: hakre's profile hakre Owned by:
Milestone: Priority: low
Severity: minor Version: 3.0
Component: General Keywords: close
Focuses: Cc:

Description

That does not work well together. I suggest adding a new parameter passing the http version to it so the return values can go conform.

Related: #9297

Attachments (9)

13940.rfc1945-http-1-0-header.txt (348 bytes) - added by hakre 14 years ago.
HTTP 1.0 Status Code and Reason Phrase
13940.rfc2616-http-1-1-header.txt (944 bytes) - added by hakre 14 years ago.
HTTP 1.1 Status Code and Reason Phrase
13940.patch (379 bytes) - added by hakre 14 years ago.
some small meat to feed the wild cats
13940.rfc4918-http-1-1-ext-webdav-header.txt (175 bytes) - added by hakre 14 years ago.
WebDAV Status Code Extensions to HTTP/1.1
13940.rfc2817-http-1-1-ext-tls-header.txt (65 bytes) - added by hakre 14 years ago.
TLS Within HTTP/1.1
13940.rfc2295-http-1-1-ext-trnscntneg-header.txt (89 bytes) - added by hakre 14 years ago.
Transparent Content Negotiation in HTTP
13940.rfc2774-http-1-1-ext-extension-header.txt (65 bytes) - added by hakre 14 years ago.
An HTTP Extension Framework
13940.rfc3229-http-1-1-ext-deltaenc-header.txt (60 bytes) - added by hakre 14 years ago.
Delta encoding in HTTP
13940.rfc5824-http-1-1-ext-bindextwebdav-header.txt (96 bytes) - added by hakre 14 years ago.
Binding Extensions to Web Distributed Authoring and Versioning (WebDAV)

Download all attachments as: .zip

Change History (28)

#1 @hakre
14 years ago

  • Component changed from General to HTTP
  • Priority changed from normal to low
  • Severity changed from normal to minor

@hakre
14 years ago

HTTP 1.0 Status Code and Reason Phrase

@hakre
14 years ago

HTTP 1.1 Status Code and Reason Phrase

#2 @dd32
14 years ago

  • Component changed from HTTP to General

What set of HTTP 1.0 messages differ from those of the HTTP 1.1 set?

#3 @markjaquith
14 years ago

  • Resolution set to invalid
  • Status changed from new to closed

The reason phrase is for humans, and as such it can be anything we want it to be. We could serve 404 OH NO and it would be fine.

The Status-Code element is a 3-digit integer result code of the attempt to understand and satisfy the request. These codes are fully defined in section 10. The Reason-Phrase is intended to give a short textual description of the Status-Code. The Status-Code is intended for use by automata and the Reason-Phrase is intended for the human user. The client is not required to examine or display the Reason- Phrase.

#4 @nacin
14 years ago

  • Keywords needs-patch removed
  • Milestone Unassigned deleted

#5 @hakre
14 years ago

Replying to dd32:

What set of HTTP 1.0 messages differ from those of the HTTP 1.1 set?

I'm compiling a list, I stumbled over some constraints in #9297 that's why it takes a bit longer.


Replying to markjaquith:

The reason phrase is for humans, and as such it can be anything we want it to be. We could serve 404 OH NO and it would be fine.

Serving 426 OH NO for HTTP 1.0 would not be fine.

You must not return wrong status-codes (which would invalidate the full phrase) in HTTP 1.0 nor in HTTP 1.1.

Please do not needlessly hunt it down before this ticket can stand on it's own feet. I'm still on the issue. Same @nacion. Thanks.

#6 @hakre
14 years ago

New Headers in HTTP 1.1 compared to HTTP 1.0

  • 100 : Continue
  • 101 : Switching Protocols
  • 203 : Non-Authoritative Information
  • 205 : Reset Content
  • 206 : Partial Content
  • 300 : Multiple Choices
  • 303 : See Other
  • 305 : Use Proxy
  • 307 : Temporary Redirect
  • 402 : Payment Required
  • 405 : Method Not Allowed
  • 406 : Not Acceptable
  • 407 : Proxy Authentication Required
  • 408 : Request Time-out
  • 409 : Conflict
  • 410 : Gone
  • 411 : Length Required
  • 412 : Precondition Failed
  • 413 : Request Entity Too Large
  • 414 : Request-URI Too Large
  • 415 : Unsupported Media Type
  • 416 : Requested range not satisfiable
  • 417 : Expectation Failed
  • 504 : Gateway Time-out
  • 505 : HTTP Version not supported

Changed Headers in HTTP 1.1 compared to HTTP 1.0

  • 302 : Found
    • HTTP 1.0: 302 : Moved Temporarily
    • HTTP 1.1: 302 : Found

@hakre
14 years ago

some small meat to feed the wild cats

#7 @hakre
14 years ago

There is no status code 306 in HTTP 1.1 or HTTP 1.0. Which version do you intend to support with WordPress?

@hakre
14 years ago

WebDAV Status Code Extensions to HTTP/1.1

@hakre
14 years ago

TLS Within HTTP/1.1

@hakre
14 years ago

Transparent Content Negotiation in HTTP

@hakre
14 years ago

An HTTP Extension Framework

@hakre
14 years ago

Delta encoding in HTTP

@hakre
14 years ago

Binding Extensions to Web Distributed Authoring and Versioning (WebDAV)

#8 follow-up: @hakre
14 years ago

  • Keywords dev-feedback added
  • Milestone set to Future Release

In the end I must admit that I do not know wether or not that function should or should not return values without taking the HTTP version as well as the REQUEST METHOD into account. Next to the status code, that would be needed as context to properly find out. So thoughtfull comment by a core dev/contributer would be nice to know.

Regarding the other flaws I've found I'll create a new ticket.

#9 @nacin
14 years ago

  • Keywords dev-feedback removed
  • Milestone Future Release deleted

Closed tickets don't have a milestone.

#10 @hakre
14 years ago

Related: #13955

#11 in reply to: ↑ 8 @hakre
14 years ago

  • Keywords needs-patch dev-feedback added

I reopen it because the dicussion lately did fail to match the point this is about:

  • How to deal with invalid Status Codes (not messages) on HTTP requests (e.g. using a non-existant status code in a HTTP/1.0 request)
  • Which HTTP standard is to be supported by WordPress?

Please see this comment by me as well hakre.

#12 @hakre
14 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

#13 @hakre
14 years ago

  • Summary changed from get_status_header_desc returns HTTP 1.1 status header messages but is used for HTTP 1.0 as well to get_status_header_desc returns HTTP 1.1 status codes but is used for HTTP 1.0 as well

#14 @hakre
14 years ago

  • Summary changed from get_status_header_desc returns HTTP 1.1 status codes but is used for HTTP 1.0 as well to get_status_header_desc() returns HTTP 1.1 status codes for HTTP 1.0

#15 @hakre
14 years ago

Status Header Related: #3528

#16 @rmccue
14 years ago

To reiterate what Mark said, the reason doesn't matter, and RFC 2616 (HTTP 1.1) notes this (section 6.1.1:

The Status-Code is intended for use by automata and the Reason-Phrase is intended for the human user. The client is not required to examine or display the Reason-Phrase.

[...]

The individual values of the numeric status codes defined for HTTP/1.1, and an example set of corresponding Reason-Phrase's, are presented below. The reason phrases listed here are only recommendations -- they MAY be replaced by local equivalents without affecting the protocol.

(Emphasis mine)

I won't close this, as I feel it's not my place to do so in this case.

#17 @hakre
14 years ago

To rephrase what I wrote in response to Mark, emphasis by me:

Replying to hakre:

Replying to markjaquith:
You must not return wrong status-codes (which would invalidate the full phrase) in HTTP 1.0 nor in HTTP 1.1.

As you can see I'm writing about codes, not phrases. This is the same for the title of this ticket.

#18 @nacin
14 years ago

  • Keywords close added; needs-patch dev-feedback removed
  • Milestone set to Awaiting Review

#19 @nacin
14 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.