mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-25 14:04:27 +00:00
Content-Type for .mp3 and .ogg files (used in Calm theme)
This commit is contained in:
parent
3d9c89889f
commit
21b0daf7f8
@ -1014,6 +1014,10 @@ void ServiceConnection(AcceptedConnection *conn)
|
|||||||
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…
x
Reference in New Issue
Block a user