-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
Description
RFC 7320 permits a number of "special" characters in the field-name of header fields, including both minus (-) and underscore (_):
header-field = field-name ":" OWS field-value OWS
field-name = token
token = 1*tchar
tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
ext-http however forces a conversion from _ to - by setting xhyphen to true in php_http_pretty_key() whenever new headers are merged. I believe the following test should work, but currently does not due to the aforementioned conversion:
--TEST--
header string with hyphens and underscores
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php
echo "Test\n";
$h = new http\Header("foo_bar-baz", "bar");
var_dump("Foo_Bar-Baz: bar" === (string) $h);
?>
Done
--EXPECT--
Test
bool(true)
Done
Reactions are currently unavailable