diff options
author | Remy <relst@relst.nl> | 2015-05-24 09:35:28 +0200 |
---|---|---|
committer | Remy <relst@relst.nl> | 2015-05-24 09:35:28 +0200 |
commit | 988f08b9eb952404b94817a973d1a19ff7c6524b (patch) | |
tree | b23c940603507f240f377ba9278b49ae97dc6190 /json.php | |
parent | 5e7e74fe94062683cce82c189cd43dd18c3aff9b (diff) | |
download | ssl-decoder-988f08b9eb952404b94817a973d1a19ff7c6524b.zip ssl-decoder-988f08b9eb952404b94817a973d1a19ff7c6524b.tar.gz ssl-decoder-988f08b9eb952404b94817a973d1a19ff7c6524b.tar.bz2 |
Add support for specific endpoints
Diffstat (limited to 'json.php')
-rw-r--r-- | json.php | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -10,13 +10,13 @@ foreach (glob("functions/*.php") as $filename) { if ( isset($_GET['host']) && !empty($_GET['host'])) { $data = []; $hostname = mb_strtolower(get($_GET['host'])); - $host = parse_hostname($hostname); - if ($host['port']) { - $port = $host['port']; - } else { - $port = get($_GET['port'], '443'); - } - $host = $host['hostname']; + $hostname = parse_hostname($hostname); + if ($hostname['multiple_ip']) { + $data["error"] = ["Host format is incorrect. (use \$host:\$ip.)"]; + } + $host = $hostname['hostname']; + $ip = $hostname['ip']; + $port = get($_GET['port'], '443'); if ( !is_numeric($port) ) { $port = 443; } @@ -25,7 +25,7 @@ if ( isset($_GET['host']) && !empty($_GET['host'])) { $hostfilename = preg_replace("([\.]{2,})", '', $host); $hostfilename = preg_replace("([^a-z0-9])", '', $host); $cache_filename = (string) "results/saved." . $hostfilename . "." . $epoch . "." . $random_bla . ".api.json"; - $data["data"] = check_json($host,$port); + $data["data"] = check_json($host, $ip, $port); } elseif(isset($_GET['csr']) && !empty($_GET['csr'])) { $write_cache = 1; $cache_filename = (string) "results/saved.csr." . $epoch . "." . $random_bla . ".api.json"; |