aboutsummaryrefslogblamecommitdiffstats
path: root/Zotlabs/Module/Sslify.php
blob: 2891f3691022cbded1f9423d664d98311c4386bf (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                                           
                                                           
                         




                                                                      



                                        
                
 
<?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;
			}
			if (array_key_exists('content-type', $hdrs)) {
				$type = $hdrs['content-type'];	
				header('Content-Type: ' . $type);
			}

			echo $x['body'];
			killme();
		}
		killme();
	}	
}