partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 0aa0746cd9789de6d613eb17313346cbeaa93a09
parent 774b7042dad43230be4344d3d6209c8f388c3d56
Author: Felicitus <felicitus@felicitus.org>
Date:   Thu, 22 Sep 2011 03:22:13 +0200

Added "call" and "service" to the list of allowed headers, moved header sending to the service

Diffstat:
Mfrontend/rest.php | 6++----
Mfrontend/service.php | 5+----
Msrc/de/RaumZeitLabor/PartKeepr/Service/ServiceManager.php | 9+++++++++
3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/frontend/rest.php b/frontend/rest.php @@ -7,10 +7,8 @@ use de\RaumZeitLabor\PartKeepr\PartKeepr, include("../src/de/RaumZeitLabor/PartKeepr/PartKeepr.php"); -header("Content-Type: text/html; charset=UTF-8"); -header("Cache-Control: no-cache, must-revalidate"); -header("Access-Control-Allow-Origin: *"); -header("Access-Control-Allow-Headers: *"); +ServiceManager::sendHeaders(); + PartKeepr::initialize(""); /** diff --git a/frontend/service.php b/frontend/service.php @@ -7,10 +7,7 @@ use de\RaumZeitLabor\PartKeepr\PartKeepr; include("../src/de/RaumZeitLabor/PartKeepr/PartKeepr.php"); -header("Content-Type: text/html; charset=UTF-8"); -header("Cache-Control: no-cache, must-revalidate"); -header("Access-Control-Allow-Origin: *"); -header("Access-Control-Allow-Headers: *"); +ServiceManager::sendHeaders(); PartKeepr::initialize(""); diff --git a/src/de/RaumZeitLabor/PartKeepr/Service/ServiceManager.php b/src/de/RaumZeitLabor/PartKeepr/Service/ServiceManager.php @@ -12,6 +12,15 @@ use de\RaumZeitLabor\PartKeepr\Service\Exceptions\ServiceException, class ServiceManager { + public static function sendHeaders () { + header("Content-Type: text/html; charset=UTF-8"); + header("Cache-Control: no-cache, must-revalidate"); + header("Access-Control-Allow-Origin: *"); + header("Access-Control-Allow-Headers: lang"); + header("Access-Control-Allow-Headers: call"); + header("Access-Control-Allow-Headers: service"); + } + public static function call () { $request = new Request(array('restful' => true));