diff --git a/fhem/FHEM/02_HTTPSRV.pm b/fhem/FHEM/02_HTTPSRV.pm index 771f49fa4..fcaa8e1dc 100644 --- a/fhem/FHEM/02_HTTPSRV.pm +++ b/fhem/FHEM/02_HTTPSRV.pm @@ -37,7 +37,7 @@ HTTPSRV_addExtension($$$$) { $data{FWEXT}{$url}{NAME} = $friendlyname; } -sub +sub HTTPSRV_removeExtension($) { my ($link)= @_; @@ -65,7 +65,7 @@ HTTPSRV_Initialize($) { #$hash->{AttrFn} = "HTTPSRV_Attr"; $hash->{AttrList} = "directoryindex " . "readings"; - $hash->{AttrFn} = "HTTPSRV_Attr"; + $hash->{AttrFn} = "HTTPSRV_Attr"; #$hash->{SetFn} = "HTTPSRV_Set"; return undef; @@ -92,7 +92,7 @@ HTTPSRV_Define($$) { Log3 $name, 3, "$name: new ext defined infix:$infix: dir:$directory:"; HTTPSRV_addExtension($name, "HTTPSRV_CGI", $infix, $friendlyname); - + $hash->{STATE} = $name; return undef; } @@ -113,7 +113,7 @@ sub HTTPSRV_Attr(@) { my ($cmd,$name,$aName,$aVal) = @_; - if ($cmd eq "set") { + if ($cmd eq "set") { if ($aName =~ "readings") { if ($aVal !~ /^[A-Z_a-z0-9\,]+$/) { Log3 $name, 3, "$name: Invalid reading list in attr $name $aName $aVal (only A-Z, a-z, 0-9, _ and , allowed)"; @@ -136,8 +136,8 @@ sub HTTPSRV_CGI() { my ($request) = @_; # /$infix/filename # Debug "request= $request"; - - # Match request first without trailing / in the link part + + # Match request first without trailing / in the link part if($request =~ m,^(/[^/]+)(/(.*)?)?$,) { my $link= $1; my $filename= $3; @@ -148,9 +148,9 @@ sub HTTPSRV_CGI() { $link = $link."/"; return("text/plain; charset=utf-8", "Illegal request: $request") if(! $data{FWEXT}{$link}); } - + # get device name - $name= $data{FWEXT}{$link}{deviceName}; + $name= $data{FWEXT}{$link}{deviceName}; # Debug "link= $link"; # Debug "filename= $filename"; @@ -169,7 +169,7 @@ sub HTTPSRV_CGI() { readingsSingleUpdate($defs{$name}, $reading, $value, 1); } }; - + # set directory index $filename= AttrVal($name,"directoryindex","index.html") unless($filename); $filename =~ s/\?.*//; @@ -191,10 +191,10 @@ sub HTTPSRV_CGI() { return("text/plain; charset=utf-8", "Illegal request: $request"); } - -} - - + +} + + #### @@ -213,7 +213,7 @@ sub HTTPSRV_CGI() {
HTTPSRV is an extension to FHEMWEB. You must install FHEMWEB to use HTTPSRV.
@@ -221,7 +221,7 @@ sub HTTPSRV_CGI() { Definedefine <name> <infix> <directory> <friendlyname>
define <name> HTTPSRV <infix> <directory> <friendlyname>
<infix>
is the portion behind the FHEMWEB base URL (usually
http://hostname:8083/fhem
), <directory>
is the absolute path the