Fix bookmarklet behind a reverse proxy

This commit is contained in:
Pierre Rudloff 2020-10-22 00:45:41 +02:00
parent 6bb577bcce
commit 7dead957f0
2 changed files with 1 additions and 2 deletions

View File

@ -54,7 +54,6 @@ class FrontController extends BaseController
*/ */
public function index(Request $request, Response $response) public function index(Request $request, Response $response)
{ {
$uri = $request->getUri()->withUserInfo('');
$this->view->render( $this->view->render(
$response, $response,
'index.tpl', 'index.tpl',
@ -63,7 +62,6 @@ class FrontController extends BaseController
'description' => $this->localeManager->t( 'description' => $this->localeManager->t(
'Easily download videos from Youtube, Dailymotion, Vimeo and other websites.' 'Easily download videos from Youtube, Dailymotion, Vimeo and other websites.'
), ),
'domain' => $uri->getScheme() . '://' . $uri->getAuthority(),
'supportedLocales' => $this->localeManager->getSupportedLocales(), 'supportedLocales' => $this->localeManager->getSupportedLocales(),
] ]
); );

View File

@ -83,6 +83,7 @@ class ViewFactory
$view->offsetSet('canonical', self::getCanonicalUrl($request)); $view->offsetSet('canonical', self::getCanonicalUrl($request));
$view->offsetSet('locale', $container->get('locale')->getLocale()); $view->offsetSet('locale', $container->get('locale')->getLocale());
$view->offsetSet('config', $container->get('config')); $view->offsetSet('config', $container->get('config'));
$view->offsetSet('domain', $uri->withPath('')->withBasePath(''));
return $view; return $view;
} }