Added .ico support for server favicon to internal HTTP handler.

This commit is contained in:
Thulinma 2013-03-12 16:20:50 +01:00
parent 6a254806c0
commit be34419da0
2 changed files with 22 additions and 0 deletions

View file

@ -136,6 +136,20 @@ namespace Connector_HTTP {
conn->SendNow(H.BuildResponse("200", "OK")); conn->SendNow(H.BuildResponse("200", "OK"));
return ret; return ret;
} //clientaccesspolicy.xml } //clientaccesspolicy.xml
// send logo icon
if (url.length() > 4 && url.substr(url.length() - 4, 4) == ".ico"){
H.Clean();
#include "icon.h"
H.SetHeader("Content-Type", "image/x-icon");
H.SetHeader("Server", "mistserver/" PACKAGE_VERSION "/" + Util::Config::libver);
H.SetHeader("Content-Length", icon_len);
H.SetBody("");
long long int ret = Util::getMS();
conn->SendNow(H.BuildResponse("200", "OK"));
conn->SendNow((const char*)icon_data, icon_len);
return ret;
}
if ((url.length() > 9 && url.substr(0, 6) == "/info_" && url.substr(url.length() - 3, 3) == ".js") if ((url.length() > 9 && url.substr(0, 6) == "/info_" && url.substr(url.length() - 3, 3) == ".js")
|| (url.length() > 10 && url.substr(0, 7) == "/embed_" && url.substr(url.length() - 3, 3) == ".js")){ || (url.length() > 10 && url.substr(0, 7) == "/embed_" && url.substr(url.length() - 3, 3) == ".js")){
@ -354,6 +368,9 @@ namespace Connector_HTTP {
H.SetVar("stream", streamname); H.SetVar("stream", streamname);
return "progressive"; return "progressive";
} }
if (ext == ".ico"){
return "internal";
}
} }
if (url == "/crossdomain.xml"){ if (url == "/crossdomain.xml"){
return "internal"; return "internal";

5
src/icon.h Normal file

File diff suppressed because one or more lines are too long