Added CORS header to load balancer, fallback no longer returns link but just the URL

This commit is contained in:
Thulinma 2017-10-26 19:06:27 +02:00
parent a053b00d49
commit dfa04695d4

View file

@ -520,8 +520,9 @@ int handleRequest(Socket::Connection &conn){
} }
if (proto != "" && bestHost && bestScore){ if (proto != "" && bestHost && bestScore){
H.Clean(); H.Clean();
H.setCORSHeaders();
H.SetHeader("Location", bestHost->details->getUrl(stream, proto) + vars); H.SetHeader("Location", bestHost->details->getUrl(stream, proto) + vars);
H.SetBody("<a href=\""+H.GetHeader("Location")+"\">Click here for stream</a>"); H.SetBody(H.GetHeader("Location"));
H.SendResponse("307", "Redirecting", conn); H.SendResponse("307", "Redirecting", conn);
H.Clean(); H.Clean();
}else{ }else{