streams/Zotlabs/Module/Sslify.php

26 lines
507 B
PHP
Raw Normal View History

2016-04-19 03:38:38 +00:00
<?php
namespace Zotlabs\Module;
class Sslify extends \Zotlabs\Web\Controller {
function init() {
$x = z_fetch_url($_REQUEST['url']);
if($x['success']) {
$h = explode("\n",$x['header']);
foreach ($h as $l) {
list($k,$v) = array_map("trim", explode(":", trim($l), 2));
$hdrs[strtolower($k)] = $v;
2016-04-19 03:38:38 +00:00
}
if (array_key_exists('content-type', $hdrs)) {
$type = $hdrs['content-type'];
header('Content-Type: ' . $type);
}
2016-04-19 03:38:38 +00:00
echo $x['body'];
killme();
}
killme();
}
2016-04-19 03:38:38 +00:00
}