Added generic CORS header adder, now used in controller, HLS output and internal HTTP handler.

This commit is contained in:
Thulinma 2015-05-12 11:23:00 +02:00
parent 2845cbedcb
commit a3bf393bea
5 changed files with 20 additions and 5 deletions

View file

@ -381,10 +381,7 @@ int Controller::handleAPIConnection(Socket::Connection & conn){
}
H.Clean();
H.SetHeader("Content-Type", "text/javascript");
H.SetHeader("Access-Control-Allow-Origin", "*");
H.SetHeader("Access-Control-Allow-Methods", "GET, POST");
H.SetHeader("Access-Control-Allow-Headers", "Content-Type, X-Requested-With");
H.SetHeader("Access-Control-Allow-Credentials", "true");
H.setCORSHeaders();
if (jsonp == ""){
H.SetBody(Response.toString() + "\n\n");
}else{