From a7782eee91a9142f38a2af8c9a46e9cf9105ab17 Mon Sep 17 00:00:00 2001 From: borisneubert <> Date: Sat, 20 Jun 2015 07:36:16 +0000 Subject: [PATCH] 02_HTTPSRV: reverted addition of backslash (it does not work as intended and it is not downward compatible) git-svn-id: https://svn.fhem.de/fhem/trunk@8781 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 -- fhem/FHEM/02_HTTPSRV.pm | 15 +++++---------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 5042879be..e4d420656 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -13,8 +13,6 @@ - bugfix: 70_Pushalot: corrected parameter order for image - change: 70_Pushalot: changed http call to non-blocking - feature: 70_Pushalot: module to send push notification to Windows Phone - - change: 02_HTTPSRV: require trailing slash in infix to foster - integration of TabletUI - feature: 59_Weather: polish translations (Lukasz) - changed: 57_CALVIEW.pm: code cleanup - bugfix: 30_pilight_*: restore (StateFn), trigger changes twice diff --git a/fhem/FHEM/02_HTTPSRV.pm b/fhem/FHEM/02_HTTPSRV.pm index 3a13ec07b..eb44b3316 100644 --- a/fhem/FHEM/02_HTTPSRV.pm +++ b/fhem/FHEM/02_HTTPSRV.pm @@ -63,9 +63,6 @@ HTTPSRV_Define($$) { return "Usage: define HTTPSRV " if(int(@a) != 5); my $name= $a[0]; my $infix= $a[2]; - if($infix !~ m-/$-) { - $infix = "$infix/"; - } my $directory= $a[3]; my $friendlyname= $a[4]; @@ -117,7 +114,7 @@ sub HTTPSRV_CGI() { my ($request) = @_; # /$infix/filename - if($request =~ m,^(/[^/]+/)((.*)?)?$,) { + if($request =~ m,^(/[^/]+)(/(.*)?)?$,) { my $link= $1; my $filename= $3; my $name; @@ -183,7 +180,7 @@ sub HTTPSRV_CGI() {

HTTPSRV

    Provides a mini HTTP server plugin for FHEMWEB. It serves files from a given directory. - It optionally accepts a query string to set readings of this device if an attribute allows the given reading.

    + It optionally accepts a query string to set readings of this device if an attribute allows the given reading

    HTTPSRV is an extension to FHEMWEB. You must install FHEMWEB to use HTTPSRV.

    @@ -194,16 +191,14 @@ sub HTTPSRV_CGI() { Defines the HTTP server. <infix> is the portion behind the FHEMWEB base URL (usually http://hostname:8083/fhem), <directory> is the absolute path the - files are served from, and <friendlyname> is the name displayed in the side menu of - FHEMWEB. <infix> should contain a trailing slash, which is automatically added to - the definition if it is missing in the define statement.

    + files are served from, and <friendlyname> is the name displayed in the side menu of FHEMWEB.

    Example:

      - define myJSFrontend HTTPSRV jsf /usr/share/jsfrontend/ My little frontend
      + define myJSFrontend HTTPSRV jsf /usr/share/jsfrontend My little frontend
      or
      - define kindleweb HTTPSRV kindle /opt/fhem/kindle/ Kindle Web
      + define kindleweb HTTPSRV kindle /opt/fhem/kindle Kindle Web
      attr kindleweb readings KindleBatt