Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3dae36a1 authored by miax's avatar miax Committed by Julian Xhokaxhiu
Browse files

Add detection of HTTP_X_FORWARDED_* headers

parent c9325f2f
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -40,6 +40,13 @@
      if ( array_key_exists('PROTO', $forwarded) && strtoupper($forwarded['PROTO']) === 'HTTPS') {
        $_SERVER['HTTPS'] = 'on';
      }
    } else {
      if ( isset($_SERVER['HTTP_X_FORWARDED_HOST']) ) {
        $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
      }
      if ( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtoupper($_SERVER['HTTP_X_FORWARDED_PROTO']) === 'HTTPS' ) {
        $_SERVER['HTTPS'] = 'on';
      }
    }

    if( isset($_SERVER['HTTPS']) )