Add CORS handling to podcast feed
This commit is contained in:
parent
f17a3cb5bb
commit
62a85bbe77
|
@ -7,14 +7,17 @@ class FeedsController extends Zend_Controller_Action
|
||||||
$this->view->layout()->disableLayout();
|
$this->view->layout()->disableLayout();
|
||||||
$this->_helper->viewRenderer->setNoRender(true);
|
$this->_helper->viewRenderer->setNoRender(true);
|
||||||
|
|
||||||
|
$request = $this->getRequest();
|
||||||
|
$response = $this->getResponse();
|
||||||
|
|
||||||
if ((Application_Model_Preference::getStationPodcastPrivacy()
|
if ((Application_Model_Preference::getStationPodcastPrivacy()
|
||||||
&& $this->getRequest()->getParam("sharing_token") != Application_Model_Preference::getStationPodcastDownloadKey())
|
&& $request->getParam("sharing_token") != Application_Model_Preference::getStationPodcastDownloadKey())
|
||||||
&& !RestAuth::verifyAuth(true, false, $this)) {
|
&& !RestAuth::verifyAuth(true, false, $this)) {
|
||||||
$this->getResponse()
|
$response->setHttpResponseCode(401);
|
||||||
->setHttpResponseCode(401);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CORSHelper::enableCrossOriginRequests($request, $response);
|
||||||
|
|
||||||
$rssData = Application_Service_PodcastService::createStationRssFeed();
|
$rssData = Application_Service_PodcastService::createStationRssFeed();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue