$pathInfo = $request->getPathInfo();
$requestUri = $request->getRequestUri();
$url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $requestUri);
return $this->redirect($url, 308);
}
public function css(Request $request, WswAuthBundle $wsw, WebsiteRenderer $renderer, $type, $id)
{
list($id, $version) = array_pad(explode('.', $id, 2), 2, null);
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
public function handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
{
if(empty($request->server->get('HTTPS')) && $request->server->get('HTTP_X_FORWARDED_PROTO')) {
$request->server->set('HTTPS', $request->server->get('HTTP_X_FORWARDED_PROTO'));
}
return parent::handle($request, $type, $catch);
}
public function getCacheDir()
{
if(in_array($this->environment, ['dev'])) {
InvalidArgumentException |
---|
InvalidArgumentException: Cannot redirect to an empty URL. at /opt/wsw/wsw-web/vendor/symfony/http-foundation/RedirectResponse.php:86 at Symfony\Component\HttpFoundation\RedirectResponse->setTargetUrl() (/opt/wsw/wsw-web/vendor/symfony/http-foundation/RedirectResponse.php:39) at Symfony\Component\HttpFoundation\RedirectResponse->__construct() (/opt/wsw/wsw-web/vendor/symfony/framework-bundle/Controller/AbstractController.php:155) at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->redirect() (/opt/wsw/wsw-web/src/Controller/Website/IndexController.php:118) at App\Controller\Website\IndexController->trailing() (/opt/wsw/wsw-web/vendor/symfony/http-kernel/HttpKernel.php:157) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (/opt/wsw/wsw-web/vendor/symfony/http-kernel/HttpKernel.php:79) at Symfony\Component\HttpKernel\HttpKernel->handle() (/opt/wsw/wsw-web/vendor/symfony/http-kernel/Kernel.php:196) at Symfony\Component\HttpKernel\Kernel->handle() (/opt/wsw/wsw-web/src/Kernel.php:78) at App\Kernel->handle() (/opt/wsw/wsw-web/public/index.php:29) |