mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-10 23:07:52 +00:00
Merge pull request #171 from dryabov/master
Correct Content-Type header for gif images
This commit is contained in:
commit
b0b9b3b49b
@ -1007,11 +1007,17 @@ void ServiceConnection(AcceptedConnection *conn)
|
|||||||
contentType = "text/css";
|
contentType = "text/css";
|
||||||
if( strURI.find(".png") != std::string::npos )
|
if( strURI.find(".png") != std::string::npos )
|
||||||
contentType = "image/png";
|
contentType = "image/png";
|
||||||
|
if( strURI.find(".gif") != std::string::npos )
|
||||||
|
contentType = "image/gif";
|
||||||
if( strURI.find(".ttf") != std::string::npos )
|
if( strURI.find(".ttf") != std::string::npos )
|
||||||
contentType = "application/x-font-ttf";
|
contentType = "application/x-font-ttf";
|
||||||
if( strURI.find(".jpg") != std::string::npos ||
|
if( strURI.find(".jpg") != std::string::npos ||
|
||||||
strURI.find(".jpeg") != std::string::npos )
|
strURI.find(".jpeg") != std::string::npos )
|
||||||
contentType = "image/jpeg";
|
contentType = "image/jpeg";
|
||||||
|
if( strURI.find(".mp3") != std::string::npos )
|
||||||
|
contentType = "audio/mpeg";
|
||||||
|
if( strURI.find(".ogg") != std::string::npos )
|
||||||
|
contentType = "audio/ogg";
|
||||||
conn->stream() << HTTPReply(HTTP_OK, str, false, contentType) << std::flush;
|
conn->stream() << HTTPReply(HTTP_OK, str, false, contentType) << std::flush;
|
||||||
} else {
|
} else {
|
||||||
printf("ServiceConnection: file %s not found\n", fname.c_str());
|
printf("ServiceConnection: file %s not found\n", fname.c_str());
|
||||||
|
Loading…
Reference in New Issue
Block a user