summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2017-07-02 16:20:45 +0200
committerJo-Philipp Wich <jo@mein.io>2017-07-02 16:20:45 +0200
commitc0a569de53db4a6cafa736386fd6feade4cd09f7 (patch)
treeef9236f0dde78435da8e56400cd252088e94dc64 /proc.c
parentad93be7632963da1bd5b67d71021d1d63ecfd909 (diff)
proc: expose HTTP_AUTH_USER and HTTP_AUTH_PASS
Mimic other web servers like Nginx or Apache and expose the parsed basic auth information as HTTP_AUTH_USER and HTTP_AUTH_PASS environment variables to CGI processes. This also restores login-from-basic-auth functionality in LuCI. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/proc.c b/proc.c
index a8a7142..e360897 100644
--- a/proc.c
+++ b/proc.c
@@ -34,7 +34,9 @@
__header(user_agent, user-agent) \
__header(content_type, content-type) \
__header(content_length, content-length) \
- __header(x_http_method_override, x-http-method-override)
+ __header(x_http_method_override, x-http-method-override) \
+ __header(http_auth_user, http-auth-user) \
+ __header(http_auth_pass, http-auth-pass)
#undef __header
#define __header __enum_header
@@ -64,6 +66,8 @@ static const struct {
{ "HTTP_REFERER", HDR_referer },
{ "HTTP_USER_AGENT", HDR_user_agent },
{ "HTTP_X_HTTP_METHOD_OVERRIDE", HDR_x_http_method_override },
+ { "HTTP_AUTH_USER", HDR_http_auth_user },
+ { "HTTP_AUTH_PASS", HDR_http_auth_pass },
{ "CONTENT_TYPE", HDR_content_type },
{ "CONTENT_LENGTH", HDR_content_length },
};