proc: expose HTTP Origin header in process environment
authorJo-Philipp Wich <jo@mein.io>
Tue, 24 Apr 2018 18:03:19 +0000 (20:03 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 24 Apr 2018 18:03:19 +0000 (20:03 +0200)
Map the "Origin:" header as $HTTP_ORIGIN environment variable for use by
request handling processes.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
proc.c

diff --git a/proc.c b/proc.c
index e360897467ef94f56035c463fffe5fa232560e02..88ec31ea8caedff8b1cff5a85cdad2bfbe56f6bb 100644 (file)
--- a/proc.c
+++ b/proc.c
@@ -30,6 +30,7 @@
        __header(connection, connection) \
        __header(cookie, cookie) \
        __header(host, host) \
+       __header(origin, origin) \
        __header(referer, referer) \
        __header(user_agent, user-agent) \
        __header(content_type, content-type) \
@@ -63,6 +64,7 @@ static const struct {
        { "HTTP_CONNECTION", HDR_connection },
        { "HTTP_COOKIE", HDR_cookie },
        { "HTTP_HOST", HDR_host },
+       { "HTTP_ORIGIN", HDR_origin },
        { "HTTP_REFERER", HDR_referer },
        { "HTTP_USER_AGENT", HDR_user_agent },
        { "HTTP_X_HTTP_METHOD_OVERRIDE", HDR_x_http_method_override },