if (!$this->isForwardedValid) { return $this->trustedValuesCache[$cacheKey] = null !== $ip ? ['0.0.0.0', $ip] : []; } $this->isForwardedValid = false; throw new ConflictingHeadersException(\sprintf('The request has both a trusted "%s" header and a trusted "%s" header, conflicting with each other. You should either configure your proxy to remove one of them, or configure your project to distrust the offending one.', self::TRUSTED_HEADERS[self::HEADER_FORWARDED], self::TRUSTED_HEADERS[$type])); } private function normalizeAndFilterClientIps(array $clientIps, string $ip): array { if (!$clientIps) { * * @throws SuspiciousOperationException when the host name is invalid or not trusted */ public function getHost(): string { if ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_X_FORWARDED_HOST)) { $host = $host[0]; } elseif (!$host = $this->headers->get('HOST')) { if (!$host = $this->server->get('SERVER_NAME')) { $host = $this->server->get('SERVER_ADDR', ''); } throw new \LogicException('Class is intended for static use only'); } public static function isCdn(Request $request): bool { return str_ends_with($request->getHost(), '.educdn.cz'); }} public function getRunner(?object $application): RunnerInterface { if ($application instanceof KernelInterface) { $request = Request::createFromGlobals(); if (!CdnDetector::isCdn($request)) { $application = new \AppCache($application); } return new HttpKernelRunner($application, $request); }$app = $app(...$args);exit( $runtime ->getRunner($app) ->run());use Seduo\Runtime\SeduoRuntime;use Symfony\Component\HttpFoundation\Request;$_ENV['APP_RUNTIME'] = SeduoRuntime::class;require_once __DIR__ . '/../vendor/autoload_runtime.php';require_once __DIR__ . '/../config/bootstrap.php';Request::setTrustedProxies( ['REMOTE_ADDR'], Request::HEADER_X_FORWARDED_FOR ||
ConflictingHeadersException
|
|---|
Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException:
The request has both a trusted "FORWARDED" header and a trusted "X_FORWARDED_HOST" header, conflicting with each other. You should either configure your proxy to remove one of them, or configure your project to distrust the offending one.
at /srv/www/seduo/vendor/symfony/http-foundation/Request.php:2096
at Symfony\Component\HttpFoundation\Request->getTrustedValues()
(/srv/www/seduo/vendor/symfony/http-foundation/Request.php:1161)
at Symfony\Component\HttpFoundation\Request->getHost()
(/srv/www/seduo/src/Seduo/Cdn/CdnDetector.php:18)
at Seduo\Cdn\CdnDetector::isCdn()
(/srv/www/seduo/src/Seduo/Runtime/SeduoRuntime.php:21)
at Seduo\Runtime\SeduoRuntime->getRunner()
(/srv/www/seduo/vendor/autoload_runtime.php:29)
at require_once('/srv/www/seduo/vendor/autoload_runtime.php')
(/srv/www/seduo/web/app.php:8)
|