Actions
Feature #1318
closeddd schema match to lighty
ASK QUESTIONS IN Forums:
Description
Hi
Please add $HTTP\scheme to lighty. This makes http->https redirection easy as shown in http://trac.lighttpd.net/trac/wiki/HowToRedirectHttpToHttps
made patch to work with svn
Index: src/configfile-glue.c =================================================================== --- src/configfile-glue.c (revision 1962) +++ src/configfile-glue.c (working copy) @@ -376,6 +376,10 @@ } break; } + case COMP_HTTP_SCHEME: + l = con->uri.scheme; + break; + case COMP_HTTP_URL: l = con->uri.path; break; Index: src/array.h =================================================================== --- src/array.h (revision 1962) +++ src/array.h (working copy) @@ -92,6 +92,7 @@ COMP_HTTP_COOKIE, COMP_HTTP_REMOTE_IP, COMP_HTTP_QUERY_STRING, + COMP_HTTP_SCHEME, COMP_HTTP_REQUEST_METHOD, COMP_PHYSICAL_PATH, COMP_PHYSICAL_PATH_EXISTS, Index: src/response.c =================================================================== --- src/response.c (revision 1962) +++ src/response.c (working copy) @@ -206,6 +206,7 @@ config_patch_connection(srv, con, COMP_HTTP_USER_AGENT);/* User-Agent: */ config_patch_connection(srv, con, COMP_HTTP_COOKIE); /* Cookie: */ config_patch_connection(srv, con, COMP_HTTP_REQUEST_METHOD); /* REQUEST_METHOD */ + config_patch_connection(srv, con, COMP_HTTP_SCHEME); /* Scheme: */ /** their might be a fragment which has to be cut away */ if (NULL != (qstr = strchr(con->request.uri->ptr, '#'))) { Index: src/configparser.y =================================================================== --- src/configparser.y (revision 1962) +++ src/configparser.y (working copy) @@ -435,6 +435,7 @@ { COMP_HTTP_REQUEST_METHOD, CONST_STR_LEN("HTTP[\"request-method\"]") }, { COMP_PHYSICAL_PATH, CONST_STR_LEN("PHYSICAL[\"path\"]") }, { COMP_PHYSICAL_PATH_EXISTS,CONST_STR_LEN("PHYSICAL[\"existing-path\"]") }, + { COMP_HTTP_SCHEME, CONST_STR_LEN("HTTP[\"scheme\"]" ) }, { COMP_UNSET, NULL, 0 }, }; Index: doc/configuration.txt =================================================================== --- doc/configuration.txt (revision 1962) +++ doc/configuration.txt (working copy) @@ -85,6 +85,8 @@ $HTTP["cookie"] match on cookie +$HTTP["scheme"] + match on scheme $HTTP["host"] match on host $HTTP["useragent"]
Updated by gstrauss over 8 years ago
- Description updated (diff)
- Assignee deleted (
jan) - Missing in 1.5.x set to Yes
FYI: already part of lighttpd 1.4.x
Actions
Also available in: Atom