From d1904cbba45ac80685ac689c2fa93cfb504c25a7 Mon Sep 17 00:00:00 2001 From: Naomi Date: Fri, 20 Dec 2013 13:03:20 -0500 Subject: [PATCH] CC-5450 : Refactor Media Management (Classes/DB) in Airtime HEAD won't work for actual streams, just m3u etc. --- .../application/forms/filters/WebstreamRedirect.php | 5 ++--- .../application/forms/validators/WebstreamUrl.php | 12 ------------ 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/airtime_mvc/application/forms/filters/WebstreamRedirect.php b/airtime_mvc/application/forms/filters/WebstreamRedirect.php index e8cd17f7b..89767118b 100644 --- a/airtime_mvc/application/forms/filters/WebstreamRedirect.php +++ b/airtime_mvc/application/forms/filters/WebstreamRedirect.php @@ -11,14 +11,13 @@ class Filter_WebstreamRedirect implements Zend_Filter_Interface return $value; } - // By default get_headers uses a GET request to fetch the headers. If you - // want to send a HEAD request instead, you can do so using a stream context: + // By default get_headers uses a GET request to fetch the headers. //using max redirects to avoid mixed headers, //can manually follow redirects if a Location header exists. stream_context_set_default( array( 'http' => array( - 'method' => 'HEAD', + 'method' => 'GET', 'max_redirects' => '1' ) ) diff --git a/airtime_mvc/application/forms/validators/WebstreamUrl.php b/airtime_mvc/application/forms/validators/WebstreamUrl.php index e0330521c..a659db319 100644 --- a/airtime_mvc/application/forms/validators/WebstreamUrl.php +++ b/airtime_mvc/application/forms/validators/WebstreamUrl.php @@ -31,18 +31,6 @@ class Validate_WebstreamUrl extends Zend_Validate_Abstract { Logging::info("checking if $value is valid"); - // By default get_headers uses a GET request to fetch the headers. If you - // want to send a HEAD request instead, you can do so using a stream context: - //using max redirects to avoid mixed headers, - //can manually follow redirects if a Location header exists. - stream_context_set_default( - array( - 'http' => array( - 'method' => 'HEAD' - ) - ) - ); - try { //get an associative array of headers. $headers = get_headers($value, 1);