Hi there,
I have a suggestion regarding get_headers, however I do not have a
knowledge of C with which to provide a patch.
The function get_headers is, as most will know, used to retrieve headers
generated by an HTTP request. The primary parameter to this, "string
$url", is provided unencoded. Due to this, any request with special
characters (i.e. a space), will return 400 BAD REQUEST. My suggestion to
remedy this, would be to internally apply the function "urlencode" to
the $url parameter. This would automatically encode any provided URL,
while remaining transparent.
Any comments?
Thanks,
Justin Martin
Justin Martin wrote:
Hi there,
I have a suggestion regarding get_headers, however I do not have a
knowledge of C with which to provide a patch.The function get_headers is, as most will know, used to retrieve headers
generated by an HTTP request. The primary parameter to this, "string
$url", is provided unencoded. Due to this, any request with special
characters (i.e. a space), will return 400 BAD REQUEST. My suggestion to
remedy this, would be to internally apply the function "urlencode" to
the $url parameter. This would automatically encode any provided URL,
while remaining transparent.Any comments?
Thanks,
Justin Martin
Hi again,
Just noticed a discrepancy in my suggestion. I hadn't taken into account
that urlencode would encode everything, including parts of the domain
name. A solution would have to be used to avoid this.
Thanks,
Justin Martin
Justin Martin wrote:
headers generated by an HTTP request. The primary parameter to this,
"string $url", is provided unencoded. Due to this, any request with
special characters (i.e. a space), will return 400 BAD REQUEST. My
Garbage in, garbage out. It is up to you to provide it with a valid URL
(spaces are not allowed in a URL).
Use e.g. http_build_query()
for the URL parameters.
Regards,
- Chris