WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#34131 closed enhancement (fixed)

Add support for HTTP/2 to status_header()

Reported by: johnbillion Owned by: wonderboymusic
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description

The status_header() function only outputs one of HTTP/1.0 {status} or HTTP/1.1 {status} based on the requested protocol in $_SERVER['SERVER_PROTOCOL'].

This function should also support HTTP/2 and HTTP/2.0 (Nginx trunk is currently using HTTP/2.0 which I'm not sure is correct).

In addition, $_SERVER['SERVER_PROTOCOL'] is used in three other places in core, so these should be updated too.

Attachments (2)

34131.diff (1.8 KB) - added by johnbillion 4 years ago.
34131.2.diff (2.7 KB) - added by wonderboymusic 4 years ago.

Download all attachments as: .zip

Change History (6)

@johnbillion
4 years ago

#1 @johnbillion
4 years ago

  • Keywords has-patch added

#2 @wonderboymusic
4 years ago

any benefit to adding a wrapper func?

#4 @wonderboymusic
4 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 34894:

Introduce wp_get_server_protocol() to DRY protocol parsing logic and make adding more protocols, like HTTP/2, easier.

Props johnbillion, wonderboymusic.
Fixes #34131.

Note: See TracTickets for help on using tickets.