mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-21 02:55:17 +00:00
33 lines
792 B
PHP
33 lines
792 B
PHP
<?php
|
|
|
|
namespace Code\Module;
|
|
|
|
use Code\Web\Controller;
|
|
use Code\Lib\Url;
|
|
|
|
class Sslify extends Controller
|
|
{
|
|
|
|
public function init()
|
|
{
|
|
$url = $_REQUEST['url'];
|
|
if ($url) {
|
|
$x = Url::get($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);
|
|
}
|
|
|
|
echo $x['body'];
|
|
killme();
|
|
}
|
|
}
|
|
killme();
|
|
}
|
|
}
|