Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
Small bug fix in determining http/https
Browse files Browse the repository at this point in the history
  • Loading branch information
avm99963 committed Jun 27, 2016
1 parent 119640f commit 81d00a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addsecuritykey.php
Expand Up @@ -199,7 +199,7 @@
<?php
echo "var req = " . json_encode($req) . ";";
echo "var sigs = " . json_encode($sigs) . ";";
echo "var host = '" . $_SERVER['REQUEST_SCHEME']."://".$_SERVER['HTTP_HOST'] . "';";
echo "var host = '" . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? "https" : "http")."://".$_SERVER['HTTP_HOST'] . "';";
?>
</script>
<script src="js/u2f-api.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion secondfactor.php
Expand Up @@ -229,7 +229,7 @@
$reqs_nojson = $u2f->getAuthenticateData($row);
$challenge = $reqs_nojson[0]->challenge;
$reqs = json_encode($reqs_nojson);
echo "<script>var req = $reqs, host = '".$_SERVER['REQUEST_SCHEME']."://".$_SERVER['HTTP_HOST']."', challenge = '".$challenge."';</script>";
echo "<script>var req = $reqs, host = '".((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? "https" : "http")."://".$_SERVER['HTTP_HOST']."', challenge = '".$challenge."';</script>";
} catch( Exception $e ) {
echo "Error: ".$e->getMessage();
}
Expand Down

0 comments on commit 81d00a5

Please sign in to comment.