Skip to content

Commit c4e43ef

Browse files
committed
Fixed canonicalization
1 parent 85e888c commit c4e43ef

File tree

1 file changed

+6
-0
lines changed
  • src/Arachne/Codeception/Util/Connector

1 file changed

+6
-0
lines changed

src/Arachne/Codeception/Util/Connector/Nette.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ public function doRequest($request)
4040
// Container initialization can't be called earlier because Nette\Http\IRequest service might be initialized too soon and amOnPage method would not work anymore.
4141
$this->container->initialize();
4242

43+
// RequestFactory leaves port NULL in CLI mode but the urls created by amOnPage have port 80 which breaks canonicalization.
44+
$url = $this->container->getByType('Nette\Http\IRequest')->getUrl();
45+
if (!$url->getPort()) {
46+
$url->setPort(80);
47+
}
48+
4349
// The HTTP code from previous test sometimes survives in http_response_code() so it's necessary to reset it manually.
4450
$httpResponse = $this->container->getByType('Nette\Http\IResponse');
4551
$httpResponse->setCode(IResponse::S200_OK);

0 commit comments

Comments
 (0)