Skip to content

Commit

Permalink
Url is always without user info
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 5, 2023
1 parent aa01a96 commit aa503fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Application/MicroPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function run(Application\Request $request): Application\Response
&& !$this->httpRequest->isAjax()
&& ($request->isMethod('get') || $request->isMethod('head'))
) {
$refUrl = $this->httpRequest->getUrl()->withoutUserInfo();
$refUrl = $this->httpRequest->getUrl();
$url = $this->router->constructUrl($request->toArray(), $refUrl);
if ($url !== null && !$refUrl->isEqual($url)) {
return new Responses\RedirectResponse($url, Http\IResponse::S301_MovedPermanently);
Expand Down Expand Up @@ -124,7 +124,7 @@ public function createTemplate(?string $class = null, ?callable $latteFactory =
$template->presenter = $this;
$template->context = $this->context;
if ($this->httpRequest) {
$url = $this->httpRequest->getUrl()->withoutUserInfo();
$url = $this->httpRequest->getUrl();
$template->baseUrl = rtrim($url->getBaseUrl(), '/');
$template->basePath = rtrim($url->getBasePath(), '/');
}
Expand Down
4 changes: 2 additions & 2 deletions src/Application/UI/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ public function canonicalize(?string $destination = null, ...$args): void
} catch (InvalidLinkException $e) {
}

if (!isset($url) || $this->httpRequest->getUrl()->withoutUserInfo()->isEqual($url)) {
if (!isset($url) || $this->httpRequest->getUrl()->isEqual($url)) {
return;
}

Expand Down Expand Up @@ -975,7 +975,7 @@ protected function requestToUrl(Application\Request $request, ?bool $relative =
{
if (!isset($this->refUrlCache)) {
$url = $this->httpRequest->getUrl();
$this->refUrlCache = new Http\UrlScript($url->withoutUserInfo()->getHostUrl() . $url->getScriptPath());
$this->refUrlCache = new Http\UrlScript($url->getHostUrl() . $url->getScriptPath());
}

if (!$this->router) {
Expand Down

0 comments on commit aa503fe

Please sign in to comment.