function get_request_protocol()

in docker/mediawiki/1/debian11/1.41/custom_settings.php [2:10]


function get_request_protocol() {
    if (array_key_exists("HTTP_X_FORWARDED_PROTO", $_SERVER)) {
        # GKE via Ingress
        return $_SERVER["HTTP_X_FORWARDED_PROTO"];
    } else {
        # No Ingress or docker run
        return stripos($_SERVER["SERVER_PROTOCOL"], "https") === 0 ? "https" : "http";
    }
}