Added .ico support for server favicon to internal HTTP handler.
This commit is contained in:
parent
6a254806c0
commit
be34419da0
2 changed files with 22 additions and 0 deletions
|
@ -137,6 +137,20 @@ namespace Connector_HTTP {
|
|||
return ret;
|
||||
} //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")
|
||||
|| (url.length() > 10 && url.substr(0, 7) == "/embed_" && url.substr(url.length() - 3, 3) == ".js")){
|
||||
std::string streamname;
|
||||
|
@ -354,6 +368,9 @@ namespace Connector_HTTP {
|
|||
H.SetVar("stream", streamname);
|
||||
return "progressive";
|
||||
}
|
||||
if (ext == ".ico"){
|
||||
return "internal";
|
||||
}
|
||||
}
|
||||
if (url == "/crossdomain.xml"){
|
||||
return "internal";
|
||||
|
|
5
src/icon.h
Normal file
5
src/icon.h
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue