@@ -257,7 +257,7 @@ public function testHeaderEventWithShouldApplyDefaultAddressFromLocalConnectionA
257
257
$ connection ->emit ('data ' , array ("GET /foo HTTP/1.0 \r\n\r\n" ));
258
258
259
259
$ this ->assertEquals ('http://127.1.1.1:8000/foo ' , $ request ->getUri ());
260
- $ this ->assertEquals ( ' 127.1.1.1:8000 ' , $ request ->getHeaderLine ('Host ' ));
260
+ $ this ->assertFalse ( $ request ->hasHeader ('Host ' ));
261
261
}
262
262
263
263
public function testHeaderEventViaHttpsShouldApplyHttpsSchemeFromLocalTlsConnectionAddress ()
@@ -550,7 +550,7 @@ public function testInvalidContentLengthRequestHeaderWillEmitError()
550
550
$ connection = $ this ->getMockBuilder ('React\Socket\Connection ' )->disableOriginalConstructor ()->setMethods (null )->getMock ();
551
551
$ parser ->handle ($ connection );
552
552
553
- $ connection ->emit ('data ' , array ("GET / HTTP/1.1 \r\nContent-Length: foo \r\n\r\n" ));
553
+ $ connection ->emit ('data ' , array ("GET / HTTP/1.1 \r\n Host: localhost \r\ nContent-Length: foo \r\n\r\n" ));
554
554
555
555
$ this ->assertInstanceOf ('InvalidArgumentException ' , $ error );
556
556
$ this ->assertSame (400 , $ error ->getCode ());
@@ -570,7 +570,7 @@ public function testInvalidRequestWithMultipleContentLengthRequestHeadersWillEmi
570
570
$ connection = $ this ->getMockBuilder ('React\Socket\Connection ' )->disableOriginalConstructor ()->setMethods (null )->getMock ();
571
571
$ parser ->handle ($ connection );
572
572
573
- $ connection ->emit ('data ' , array ("GET / HTTP/1.1 \r\nContent-Length: 4 \r\nContent-Length: 5 \r\n\r\n" ));
573
+ $ connection ->emit ('data ' , array ("GET / HTTP/1.1 \r\n Host: localhost \r\ nContent-Length: 4 \r\nContent-Length: 5 \r\n\r\n" ));
574
574
575
575
$ this ->assertInstanceOf ('InvalidArgumentException ' , $ error );
576
576
$ this ->assertSame (400 , $ error ->getCode ());
@@ -590,7 +590,7 @@ public function testInvalidTransferEncodingRequestHeaderWillEmitError()
590
590
$ connection = $ this ->getMockBuilder ('React\Socket\Connection ' )->disableOriginalConstructor ()->setMethods (null )->getMock ();
591
591
$ parser ->handle ($ connection );
592
592
593
- $ connection ->emit ('data ' , array ("GET / HTTP/1.1 \r\nTransfer-Encoding: foo \r\n\r\n" ));
593
+ $ connection ->emit ('data ' , array ("GET / HTTP/1.1 \r\n Host: localhost \r\ nTransfer-Encoding: foo \r\n\r\n" ));
594
594
595
595
$ this ->assertInstanceOf ('InvalidArgumentException ' , $ error );
596
596
$ this ->assertSame (501 , $ error ->getCode ());
@@ -610,7 +610,7 @@ public function testInvalidRequestWithBothTransferEncodingAndContentLengthWillEm
610
610
$ connection = $ this ->getMockBuilder ('React\Socket\Connection ' )->disableOriginalConstructor ()->setMethods (null )->getMock ();
611
611
$ parser ->handle ($ connection );
612
612
613
- $ connection ->emit ('data ' , array ("GET / HTTP/1.1 \r\nTransfer-Encoding: chunked \r\nContent-Length: 0 \r\n\r\n" ));
613
+ $ connection ->emit ('data ' , array ("GET / HTTP/1.1 \r\n Host: localhost \r\ nTransfer-Encoding: chunked \r\nContent-Length: 0 \r\n\r\n" ));
614
614
615
615
$ this ->assertInstanceOf ('InvalidArgumentException ' , $ error );
616
616
$ this ->assertSame (400 , $ error ->getCode ());
@@ -762,7 +762,7 @@ public function testQueryParmetersWillBeSet()
762
762
private function createGetRequest ()
763
763
{
764
764
$ data = "GET / HTTP/1.1 \r\n" ;
765
- $ data .= "Host: example.com:80 \r\n" ;
765
+ $ data .= "Host: example.com \r\n" ;
766
766
$ data .= "Connection: close \r\n" ;
767
767
$ data .= "\r\n" ;
768
768
@@ -772,7 +772,7 @@ private function createGetRequest()
772
772
private function createAdvancedPostRequest ()
773
773
{
774
774
$ data = "POST /foo?bar=baz HTTP/1.1 \r\n" ;
775
- $ data .= "Host: example.com:80 \r\n" ;
775
+ $ data .= "Host: example.com \r\n" ;
776
776
$ data .= "User-Agent: react/alpha \r\n" ;
777
777
$ data .= "Connection: close \r\n" ;
778
778
$ data .= "\r\n" ;
0 commit comments