[wp-trac] [WordPress Trac] #54225: Request header key case inconsistencies

WordPress Trac noreply at wordpress.org
Wed Sep 14 11:30:58 UTC 2022


#54225: Request header key case inconsistencies
-------------------------------------+---------------------
 Reporter:  johnjamesjacoby          |       Owner:  (none)
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  6.1
Component:  HTTP API                 |     Version:  2.7
 Severity:  normal                   |  Resolution:
 Keywords:  2nd-opinion needs-patch  |     Focuses:  docs
-------------------------------------+---------------------

Comment (by mhkuu):

 I've created a patch:

 - Header creation now always used the capitalized forms, also with
 `$request->add_header` and `$request->set_header` (mainly called in the
 `tests`)
 - Calls to `wp_remote_retrieve_header` and `wp_get_http_headers` now
 always use a capitalized term as the second argument.
 - Docblocks and inline comments are updated to reflect the fact that we
 use capitalized terms in the code.
 - I also updated the deprecated files `src/wp-includes/class-json.php` and
 `src/wp-includes/class-snoopy.php` for consistency.
 - The return value of `wp_get_http_headers` was updated to reflect that a
 `Requests_Utility_CaseInsensitiveDictionary` is returned, rather than a
 `string`.

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


More information about the wp-trac mailing list