title: symfony 4: Request.getScheme() return http with X_FORWARDED_PROTO https
body: <p>from the <code>$_SERVER</code> php array:</p>
  
  <pre><code>$_SERVER['APP_ENV']                 prod
  $_SERVER['APP_DEBUG']               0
  $_SERVER['TRUSTED_PROXIES']         172.16.0.0/12
  $_SERVER['HTTP_X_FORWARDED_FOR']    XXX.XXX.XXX.XXX
  $_SERVER['HTTP_X_FORWARDED_HOST']   my.website.com
  $_SERVER['HTTP_X_FORWARDED_PORT']   443
  $_SERVER['HTTP_X_FORWARDED_PROTO']  https
  </code></pre>
  
  <p>from the HTTP Headers:</p>
  
  <pre><code>X-Forwarded-For     XXX.XXX.XXX.XXX
  X-Forwarded-Host    my.website.com
  X-Forwarded-Port    443
  X-Forwarded-Proto   https
  </code></pre>
  
  <p>in <code>src/public/index.php</code></p>
  
  <pre><code>if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {
      Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
  }
  </code></pre>
  
  <p>in <code>/src/Controller/TestController.php</code></p>
  
  <pre><code>class TestController 
  {
      public function index(Request $request)
      {
          $response = new Response();
          $response-&gt;setContent(  $request-&gt;getScheme() );
          return $response;
      }
  }
  </code></pre>
  
  <p>output</p>
  
  <pre><code>http
  </code></pre>
  
  <p>but the expected output is </p>
  
  <pre><code>https
  </code></pre>
  
  <p>why symfony return the wrong http scheme?</p>