Skip to content

Commit

Permalink
Use relative urls instead of the request url:
Browse files Browse the repository at this point in the history
Former-commit-id: 040034a
Former-commit-id: 99b6326c6aef8fb47c2451252453909f9ad4b55f
  • Loading branch information
KorvinSzanto committed Oct 12, 2016
1 parent 9a9a1b6 commit 95687fe
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
8 changes: 0 additions & 8 deletions concrete/src/Url/Resolver/CanonicalUrlResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,6 @@ public function resolve(array $arguments, $resolved = null)
}
}
}
} else {
$host = $this->request->getHost();
$scheme = $this->request->getScheme();
if ($scheme && $host) {
$url = $url->setScheme($scheme)
->setHost($host)
->setPort($this->request->getPort());
}
}

if ($relative_path = $this->app['app_relative_path']) {
Expand Down
11 changes: 0 additions & 11 deletions tests/config/concrete.php

This file was deleted.

11 changes: 11 additions & 0 deletions tests/config/site.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

return [
'sites' => [
'default' => [
'seo' => [
'canonical_url' => 'http://www.dummyco.com/',
],
],
],
];
3 changes: 2 additions & 1 deletion tests/tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
array(),
array(),
array(),
array('HTTP_HOST' => 'www.dummyco.com', 'SCRIPT_NAME' => '/path/to/server/index.php')
array('HTTP_HOST' => 'www.requestdomain.com', 'SCRIPT_NAME' => '/path/to/server/index.php')
);
define('BASE_URL', 'http://www.dummyco.com/path/to/server');
\Concrete\Core\Http\Request::setInstance($r);
Expand Down Expand Up @@ -82,6 +82,7 @@
$cn->query('CREATE DATABASE concrete5_tests');
$cn->close();


/*
* Kill this because it plays hell with phpunit.
*/
Expand Down

0 comments on commit 95687fe

Please sign in to comment.