Permalink
Browse files

webserver: add some explanatory comments

  • Loading branch information...
1 parent dfaed24 commit 56acc14dd03794a4b6fb2023b225b8b4fe2ee577 @Montellese committed Sep 4, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 xbmc/network/WebServer.cpp
View
2 xbmc/network/WebServer.cpp
@@ -382,12 +382,14 @@ int CWebServer::CreateFileDownloadResponse(struct MHD_Connection *connection, co
MHD_add_response_header(response, "Content-Length", contentLength);
}
+ // set the Content-Type header
CStdString ext = URIUtils::GetExtension(strURL);
ext = ext.ToLower();
const char *mime = CreateMimeTypeFromExtension(ext.c_str());
if (mime)
MHD_add_response_header(response, "Content-Type", mime);
+ // set the Expires header
CDateTime expiryTime = CDateTime::GetCurrentDateTime();
expiryTime += CDateTimeSpan(1, 0, 0, 0);
MHD_add_response_header(response, "Expires", expiryTime.GetAsRFC1123DateTime());

0 comments on commit 56acc14

Please sign in to comment.