Added CORS headers to HSS output, added HTTP OPTIONS support to HLS and HSS outputs.
This commit is contained in:
parent
8e4985801a
commit
b7b2bb5f68
2 changed files with 23 additions and 0 deletions
|
@ -151,6 +151,17 @@ namespace Mist {
|
|||
return;
|
||||
} //crossdomain.xml
|
||||
|
||||
if (H.method == "OPTIONS"){
|
||||
H.Clean();
|
||||
H.SetHeader("Content-Type", "application/octet-stream");
|
||||
H.SetHeader("Cache-Control", "no-cache");
|
||||
H.setCORSHeaders();
|
||||
H.SetBody("");
|
||||
H.SendResponse("200", "OK", myConn);
|
||||
H.Clean();
|
||||
return;
|
||||
}
|
||||
|
||||
if (H.url.find("hls") == std::string::npos){
|
||||
myConn.close();
|
||||
return;
|
||||
|
|
|
@ -281,6 +281,7 @@ namespace Mist {
|
|||
|
||||
H.Clean();
|
||||
H.SetHeader("Content-Type", "video/mp4");
|
||||
H.setCORSHeaders();
|
||||
H.StartResponse(H, myConn);
|
||||
H.Chunkify(moof_box.asBox(), moof_box.boxedSize(), myConn);
|
||||
int size = htonl(keySize + 8);
|
||||
|
@ -437,12 +438,23 @@ namespace Mist {
|
|||
|
||||
|
||||
void OutHSS::onHTTP() {
|
||||
if (H.method == "OPTIONS"){
|
||||
H.Clean();
|
||||
H.SetHeader("Content-Type", "application/octet-stream");
|
||||
H.SetHeader("Cache-Control", "no-cache");
|
||||
H.setCORSHeaders();
|
||||
H.SetBody("");
|
||||
H.SendResponse("200", "OK", myConn);
|
||||
H.Clean();
|
||||
return;
|
||||
}
|
||||
initialize();
|
||||
if (H.url.find("Manifest") != std::string::npos) {
|
||||
//Manifest, direct reply
|
||||
H.Clean();
|
||||
H.SetHeader("Content-Type", "text/xml");
|
||||
H.SetHeader("Cache-Control", "no-cache");
|
||||
H.setCORSHeaders();
|
||||
std::string manifest = smoothIndex();
|
||||
H.SetBody(manifest);
|
||||
H.SendResponse("200", "OK", myConn);
|
||||
|
|
Loading…
Add table
Reference in a new issue