Skip to content

Commit 9b05f37

Browse files
authored
Merge pull request #78 from clue-labs/empty-request-uri
Fix notice when verifying empty request URI
2 parents 47e0e8e + c22b37c commit 9b05f37

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/Handshake/RequestVerifier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function verifyHTTPVersion($val): bool {
5353
* @return bool
5454
*/
5555
public function verifyRequestURI(string $val): bool {
56-
if ($val[0] !== '/') {
56+
if ($val === '' || $val[0] !== '/') {
5757
return false;
5858
}
5959

tests/unit/Handshake/RequestVerifierTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ public static function uRIProvider(): array {
6767
array(false, '/chat#bad'),
6868
array(false, 'nope'),
6969
array(false, '/ ಠ_ಠ '),
70-
array(false, '/✖')
70+
array(false, '/✖'),
71+
array(false, '')
7172
);
7273
}
7374

0 commit comments

Comments
 (0)