<p dir="auto">Hello,</p>
<p dir="auto">So recently we discovered an issue with one site we built when using android chrome with the data saver mode turned on. Basically data saver mode uses a google proxy. The main page would load, but all 'sub' pages returned a 404. Digging around we found an exception in the prod.log.</p>
<p dir="auto">[2016-11-22 09:16:29] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\BadRequestHttpException:<br>
The request headers contain conflicting information regarding the origin of this request. at vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:67 Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException(code: 0): The request has both a trusted Forwarded header and a trusted Client IP header, conflicting with each other with regards to the originating IP addresses of the request. This is the result of a misconfiguration. You should either configure your proxy only to send one of these headers, or configure Symfony to distrust one of them.</p>
<p dir="auto">The headers being sent were:<br>
Array<br>
(<br>
[Host] =&gt; <a href="http://www.oursite.com" rel="nofollow">www.oursite.com</a><br>
[Accept] =&gt; text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,<em>/</em>;q=0.8<br>
[Accept-Encoding] =&gt; gzip, deflate, sdch<br>
[Accept-Language] =&gt; en-US,en;q=0.8,fr-CA;q=0.6,fr;q=0.4,es;q=0.2<br>
[Cache-Control] =&gt; max-age=0<br>
[Forwarded] =&gt; for=70.72.63.221<br>
[Save-Data] =&gt; on<br>
[Scheme] =&gt; http<br>
[Upgrade-Insecure-Requests] =&gt; 1<br>
[Via] =&gt; 1.1 Chrome-Compression-Proxy<br>
[X-Forwarded-For] =&gt; 70.72.63.221<br>
[Connection] =&gt; Keep-alive<br>
)</p>
<p dir="auto">Which shows it has both headers, but they match (other than for=X in the Forwarded header).</p>
<p dir="auto">What I'm wondering is if this should have caused the error it did? Looking at the bootstrap.php.cache relevant code it checks it the addresses match, but I'm not 100% sure if it should have been an error.</p>
<p dir="auto">This is also somewhat problematic since we didn't configure any proxy settings. This is a user proxy that they can enable/disable and since there are so many android devices out there with Chrome, this could affect any site using symfony. Oddly enough another site using a similar set of bundles doesn't have these issues so I'm quite confused.</p>
<p dir="auto">Hello.<br>
I'm using Symfony 2.8.12</p>
<p dir="auto">Error message:</p>
<blockquote>
<p dir="auto">PHP Fatal error:  Uncaught exception 'Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException' with message 'The request has both a trusted Forwarded header and a trusted Client IP header, conflicting with each other with regards to the originating IP addresses of the request. This is the result of a misconfiguration. You should either configure your proxy only to send one of these headers, or configure Symfony to distrust one of them.' in /[...]/app/bootstrap.php.cache:783\nStack trace:</p>
<h1 dir="auto">0 /[...]/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ValidateRequestListener.php(40): Symfony\Component\HttpFoundation\Request-&gt;getClientIps()</h1>
<h1 dir="auto">1 [internal function]: Symfony\Component\HttpKernel\EventListener\ValidateRequestListener-&gt;onKernelRequest(Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher))</h1>
<h1 dir="auto">2 /[...]/app/cach in /[...]/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php on line 67, referer: [...]</h1>
</blockquote>
<p dir="auto">This error happens only when we use Google Data Compression Proxy. This is option in Chrome Mobile browser "Saving data" (or maybe "Data compression" in Polish it's "Oszczędzanie danych"). While it's turned on, we get this message when we tried enter on any site.</p>
<p dir="auto">This error doesn't happen in earlier versions of Symfony. Some of projects using version 2.8.5 and it working fine.<br>
Probably <a href="https://github.com/symfony/http-foundation/commit/e8fa5fede69ff2bc38cacf4768a679eb77123c5a">this change</a> make a trouble.</p>
<p dir="auto">Only this change working for me and prevent from errors<br>
<code class="notranslate">unset($_SERVER["HTTP_FORWARDED"]);</code></p>
<p dir="auto">Probably it's connected with <a href="https://github.com/contao/standard-edition/issues/45" data-hovercard-type="issue" data-hovercard-url="/contao/standard-edition/issues/45/hovercard">this error</a></p>
<p dir="auto">Regards and thanks for any help.</p>