Bug #73425 [Com]: get_headers() and default GET requests
| From: | spam2 at rhsoft dot net | Date: | Sun, 25 Mar 2018 17:13:31 +0000 |
| Subject: | Bug #73425 [Com]: get_headers() and default GET requests | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214472@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73425&edit=1
ID: 73425
Comment by: spam2 at rhsoft dot net
Reported by: spam2 at rhsoft dot net
Summary: get_headers() and default GET requests
Status: Open
Type: Bug
Package: Performance problem
PHP Version: 7.0.12
Block user comment: N
Private report: N
New Comment:
cool, thanks
whoever is adapting the manual shoul also think about the other languages and *at least* adopt the
params and types on top (it's not the only function which is lacking basic infos like params
over time and even wrong types are in general only fixed for the english version)
http://php.net/manual/en/function.get-headers.php
http://php.net/manual/de/function.get-headers.php
Previous Comments:
------------------------------------------------------------------------
[2018-03-25 16:59:58] cmb@php.net
FWIW, as of PHP 7.1.0, get_headers() supports an optional $context
argument.
------------------------------------------------------------------------
[2016-10-31 05:34:39] spam2 at rhsoft dot net
Description:
------------
"By default get_headers uses a GET request" is not common sense especially when you can
only change that with stream_context_set_default() other than file_get_contents which has a context
param
what's the point of that insane default while no server refuses HEAD requests which are logical
here by the functions name and behavior - even a httpd with <Limit GET POST> won't refuse
HEAD-requests, ours are configzred that way
and no, please don't come with identical behavior and using stream wrappers for everything,
when soemone wants to do that he can just achieve the same with file_get_contents which has in fact
even a sane context param
what someone expects froma function called get_headers() is, well, just fetch the headers and not
the body which is thrown away and if one implements such a unexpetable default it's not enough
that you need to *scroll down* in teh documentation to find that out - common sense and least
surprise
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73425&edit=1