I'm using react/http on my local server which is creating server to interact with HomeKit. And the latest version break parsing incoming request because of host name.
Data which are sent by HomeKit to my server may look like this:
POST /pair-verify HTTP/1.1\r\n
Host: HomeKit\032Integration\0322509EB._hap._tcp.local\r\n
Content-Length: 37\r\n
Content-Type: application/pairing+tlv8\r\n
\r\n
\x06\x01\x01\x03 … \xE73o\xE1\xE0o\x82\xB6\xE1\x17
And this data are taken by RequestHeaderParser to parse -> ServerRequest -> new Uri and here it crashes:
if ($parts === false || (isset($parts['scheme']) && !\preg_match('#^[a-z]+$#i', $parts['scheme'])) || (isset($parts['host']) && \preg_match('#[\s_%+]#', $parts['host']))) {
throw new \InvalidArgumentException('Invalid URI given');
}
because the uri is: http://HomeKit\032Integration\0322509EB._hap._tcp.local/pair-verify
I'm using react/http on my local server which is creating server to interact with HomeKit. And the latest version break parsing incoming request because of host name.
Data which are sent by HomeKit to my server may look like this:
And this data are taken by
RequestHeaderParserto parse ->ServerRequest->new Uriand here it crashes:because the uri is:
http://HomeKit\032Integration\0322509EB._hap._tcp.local/pair-verify