summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-05-30 22:48:03 +0200
committerJo-Philipp Wich <jow@openwrt.org>2015-05-30 22:48:03 +0200
commita91aac9419f535f067ac17c16475912062d947ea (patch)
tree204d62a4849216a302c71061a9e872fe05d31a01 /proc.c
parent9f40e8f91ec6475308c265ea37b25033f616ce48 (diff)
proc: add HTTPS environment variable
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index 9c4b685..d4f5e3d 100644
--- a/proc.c
+++ b/proc.c
@@ -81,6 +81,7 @@ enum extra_vars {
VAR_METHOD,
VAR_PATH_INFO,
VAR_USER,
+ VAR_HTTPS,
VAR_REDIRECT,
VAR_SERVER_NAME,
VAR_SERVER_ADDR,
@@ -108,6 +109,7 @@ static struct env_var extra_vars[] = {
[VAR_METHOD] = { "REQUEST_METHOD" },
[VAR_PATH_INFO] = { "PATH_INFO" },
[VAR_USER] = { "REMOTE_USER" },
+ [VAR_HTTPS] = { "HTTPS" },
[VAR_REDIRECT] = { "REDIRECT_STATUS", redirect_status },
[VAR_SERVER_NAME] = { "SERVER_NAME", local_addr },
[VAR_SERVER_ADDR] = { "SERVER_ADDR", local_addr },
@@ -143,6 +145,7 @@ struct env_var *uh_get_process_vars(struct client *cl, struct path_info *pi)
extra_vars[VAR_METHOD].value = http_methods[req->method];
extra_vars[VAR_PATH_INFO].value = pi->info;
extra_vars[VAR_USER].value = req->realm ? req->realm->user : NULL;
+ extra_vars[VAR_HTTPS].value = cl->tls ? "on" : NULL;
snprintf(redirect_status, sizeof(redirect_status),
"%d", req->redirect_status);