2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 20:57:11 +00:00

bugfix: now really returns MIME type

git-svn-id: https://svn.fhem.de/fhem/trunk@1830 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2012-09-05 18:43:23 +00:00
parent a649867e90
commit d8bca88c8d

View File

@ -77,7 +77,7 @@ HTTPSRV_CGI(){
my $MIMEtype= filename2MIMEType($filename);
#return("text/plain; charset=utf-8", "HTTPSRV device: $name, filename: $filename, MIME type: $MIMEtype");
if(!defined($defs{$name})) {
return("$MIMEtype; charset=utf-8", "Unknown HTTPSRV device: $name");
return("text/plain; charset=utf-8", "Unknown HTTPSRV device: $name");
}
my $directory= $defs{$name}{fhem}{directory};
$filename= "$directory/$filename";
@ -86,7 +86,7 @@ HTTPSRV_CGI(){
binmode(INPUTFILE);
@contents= <INPUTFILE>;
close(INPUTFILE);
return("", join("", @contents));
return("$MIMEtype; charset=utf-8", join("", @contents));
} else {
return("text/plain; charset=utf-8", "File not found: $filename");
}