Open FGasper opened 3 years ago
> perl -MData::Dumper -MHTTP::Parser::XS -E'my $req = "GET / HTTP/1.0\r\nHost: haha.com\r\nFoo: épée\r\n\r\n"; utf8::upgrade($req); my %env; say HTTP::Parser::XS::parse_http_request($req, \%env); print Dumper \%env;' 51 $VAR1 = { 'REQUEST_URI' => '/', 'QUERY_STRING' => '', 'HTTP_HOST' => 'haha.com', 'REQUEST_METHOD' => 'GET', 'SCRIPT_NAME' => '', 'SERVER_PROTOCOL' => 'HTTP/1.0', 'PATH_INFO' => '/', 'HTTP_FOO' => 'épée' };
Without the utf8::upgrade it looks as you’d expect:
utf8::upgrade
> perl -MData::Dumper -MHTTP::Parser::XS -E'my $req = "GET / HTTP/1.0\r\nHost: haha.com\r\nFoo: épée\r\n\r\n"; my %env; say HTTP::Parser::XS::parse_http_request($req, \%env); print Dumper \%env;' 47 $VAR1 = { 'HTTP_HOST' => 'haha.com', 'HTTP_FOO' => 'épée', 'QUERY_STRING' => '', 'REQUEST_URI' => '/', 'SCRIPT_NAME' => '', 'SERVER_PROTOCOL' => 'HTTP/1.0', 'REQUEST_METHOD' => 'GET', 'PATH_INFO' => '/' };
Without the
utf8::upgrade
it looks as you’d expect: