Issue 1:
Hello,

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.

[2016-11-22 09:16:29] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\BadRequestHttpException:

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.

The headers being sent were:

Array

(

[Host] => www.oursite.com

[Accept] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8

[Accept-Encoding] => gzip, deflate, sdch

[Accept-Language] => en-US,en;q=0.8,fr-CA;q=0.6,fr;q=0.4,es;q=0.2

[Cache-Control] => max-age=0

[Forwarded] => for=70.72.63.221

[Save-Data] => on

[Scheme] => http

[Upgrade-Insecure-Requests] => 1

[Via] => 1.1 Chrome-Compression-Proxy

[X-Forwarded-For] => 70.72.63.221

[Connection] => Keep-alive

)

Which shows it has both headers, but they match (other than for=X in the Forwarded header).

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.

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.

Issue 2:
Hello.

I'm using Symfony 2.8.12

Error message:

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:

0 /[...]/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ValidateRequestListener.php(40): Symfony\Component\HttpFoundation\Request->getClientIps()

1 [internal function]: Symfony\Component\HttpKernel\EventListener\ValidateRequestListener->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\GetResponseEvent), 'kernel.request', Object(Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher))

2 /[...]/app/cach in /[...]/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php on line 67, referer: [...]

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.

This error doesn't happen in earlier versions of Symfony. Some of projects using version 2.8.5 and it working fine.

Probably this change make a trouble.

Only this change working for me and prevent from errors

unset($_SERVER["HTTP_FORWARDED"]);

Probably it's connected with this error

Regards and thanks for any help.