streams/Zotlabs/Module/Sslify.php

30 lines
676 B
PHP
Raw Normal View History

2016-04-19 03:38:38 +00:00
<?php
2021-12-03 03:01:39 +00:00
namespace Zotlabs\Module;
2016-04-19 03:38:38 +00:00
2021-12-02 22:33:36 +00:00
use Zotlabs\Web\Controller;
2021-12-02 23:02:31 +00:00
class Sslify extends Controller
{
2016-04-19 03:38:38 +00:00
2021-12-02 23:02:31 +00:00
public 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;
}
if (array_key_exists('content-type', $hdrs)) {
$type = $hdrs['content-type'];
header('Content-Type: ' . $type);
}
2021-12-02 23:02:31 +00:00
echo $x['body'];
killme();
}
killme();
}
2016-04-19 03:38:38 +00:00
}