- new helper functions ext2MIMEType(), filename2MIMEType()

- 02_HTTPSRV also serves files from subdirectories
- 02_HTTPSRV sends MIME types

git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@1825 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert
2012-09-01 17:09:33 +00:00
parent 8babd00c87
commit 4bfd85aa05
3 changed files with 34 additions and 11 deletions

View File

@@ -313,14 +313,7 @@ FW_ServeSpecial($$$) {
binmode(FH) if($ext =~ m/$ICONEXTENSION/); # necessary for Windows
FW_pO join("", <FH>);
close(FH);
$FW_RETTYPE = "text/plain" if($ext eq "txt");
$FW_RETTYPE = "text/html" if($ext eq "html");
$FW_RETTYPE = "application/pdf" if($ext eq "pdf");
$FW_RETTYPE = "text/css" if($ext eq "css");
$FW_RETTYPE = "image/jpeg" if($ext eq "jpg");
$FW_RETTYPE = "image/png" if($ext eq "png");
$FW_RETTYPE = "image/gif" if($ext eq "gif");
$FW_RETTYPE = "image/x-icon" if($ext eq "ico");
$FW_RETTYPE = ext2MIMEType($ext);
return 1;
}