uhttpd: add support for enforcing https
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 30 May 2015 20:55:14 +0000 (20:55 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 30 May 2015 20:55:14 +0000 (20:55 +0000)
Also set HTTPS environment variable for CGI programs on SSL connections.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
SVN-Revision: 45852

package/network/services/uhttpd/Makefile
package/network/services/uhttpd/files/uhttpd.config
package/network/services/uhttpd/files/uhttpd.init

index 3fa0ab3aaed0296675f94103043c69cfa9e66921..c499f8bb53684e0d959330d08ccdb6ba98b97d42 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uhttpd
-PKG_VERSION:=2015-05-30
+PKG_VERSION:=2015-05-31
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=git://nbd.name/uhttpd2.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=618493e378e2239f0d30902e47adfa134e649fdc
+PKG_SOURCE_VERSION:=a91aac9419f535f067ac17c16475912062d947ea
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
 PKG_LICENSE:=ISC
index 83734af5a9328bf385e2db6416f950fdcc9d105b..9df6e24527667fd793e43d7005cd705007dc4927 100644 (file)
@@ -9,6 +9,9 @@ config uhttpd main
        list listen_https       0.0.0.0:443
        list listen_https       [::]:443
 
+       # Redirect HTTP requests to HTTPS if possible
+       option redirect_https   1
+
        # Server document root
        option home             /www
 
index c493aafe4255d0eade70bafe6566752669f86902..1ebe38e8d304e85885f3dc78c241c67206c803a9 100755 (executable)
@@ -126,6 +126,8 @@ start_instance()
                                procd_append_param command -s "$listen"
                        done
                }
+
+               append_bool "$cfg" redirect_https "-q" 0
        }
 
        procd_close_instance