Commit 9913842a authored by Andrey Filippov's avatar Andrey Filippov

added Access-Control-Allow-Origin

parent c428b27f
...@@ -1734,6 +1734,7 @@ function respond_xml($result,$error=null,$color_mode = 3){ // default white bold ...@@ -1734,6 +1734,7 @@ function respond_xml($result,$error=null,$color_mode = 3){ // default white bold
$xml->addChild ('error','"'.$error.'"'); $xml->addChild ('error','"'.$error.'"');
} }
$rslt=$xml->asXML(); $rslt=$xml->asXML();
header('Access-Control-Allow-Origin: *');
header("Content-Type: text/xml"); header("Content-Type: text/xml");
header("Content-Length: ".strlen($rslt)."\n"); header("Content-Length: ".strlen($rslt)."\n");
header("Pragma: no-cache\n"); header("Pragma: no-cache\n");
...@@ -2102,6 +2103,7 @@ function reboot_me(){ ...@@ -2102,6 +2103,7 @@ function reboot_me(){
if (array_key_exists ( 'reboot', $_GET )) { if (array_key_exists ( 'reboot', $_GET )) {
// TODO: change the response to respond_xml() // TODO: change the response to respond_xml()
$rslt = "<?xml version=\"1.0\"?><root><reboot>Rebooting standalone camera...</reboot></root>\n"; $rslt = "<?xml version=\"1.0\"?><root><reboot>Rebooting standalone camera...</reboot></root>\n";
header('Access-Control-Allow-Origin: *');
header("Content-Type: text/xml"); header("Content-Type: text/xml");
header("Content-Length: ".strlen($rslt)."\n"); header("Content-Length: ".strlen($rslt)."\n");
header("Pragma: no-cache\n"); header("Pragma: no-cache\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment