Mercurial > hg > nginx
comparison src/http/modules/ngx_http_rewrite_module.c @ 6899:d2b2ff157da5
Variables: generic prefix variables.
author | Dmitry Volyntsev <xeioex@nginx.com> |
---|---|
date | Tue, 31 Jan 2017 21:19:58 +0300 |
parents | 2cd019520210 |
children | b64adc956643 |
comparison
equal
deleted
inserted
replaced
6885:25203fc377fb | 6899:d2b2ff157da5 |
---|---|
915 } | 915 } |
916 | 916 |
917 value[1].len--; | 917 value[1].len--; |
918 value[1].data++; | 918 value[1].data++; |
919 | 919 |
920 v = ngx_http_add_variable(cf, &value[1], NGX_HTTP_VAR_CHANGEABLE); | 920 v = ngx_http_add_variable(cf, &value[1], |
921 NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_WEAK); | |
921 if (v == NULL) { | 922 if (v == NULL) { |
922 return NGX_CONF_ERROR; | 923 return NGX_CONF_ERROR; |
923 } | 924 } |
924 | 925 |
925 index = ngx_http_get_variable_index(cf, &value[1]); | 926 index = ngx_http_get_variable_index(cf, &value[1]); |
926 if (index == NGX_ERROR) { | 927 if (index == NGX_ERROR) { |
927 return NGX_CONF_ERROR; | 928 return NGX_CONF_ERROR; |
928 } | 929 } |
929 | 930 |
930 if (v->get_handler == NULL | 931 if (v->get_handler == NULL) { |
931 && ngx_strncasecmp(value[1].data, (u_char *) "http_", 5) != 0 | |
932 && ngx_strncasecmp(value[1].data, (u_char *) "sent_http_", 10) != 0 | |
933 && ngx_strncasecmp(value[1].data, (u_char *) "upstream_http_", 14) != 0 | |
934 && ngx_strncasecmp(value[1].data, (u_char *) "cookie_", 7) != 0 | |
935 && ngx_strncasecmp(value[1].data, (u_char *) "upstream_cookie_", 16) | |
936 != 0 | |
937 && ngx_strncasecmp(value[1].data, (u_char *) "arg_", 4) != 0) | |
938 { | |
939 v->get_handler = ngx_http_rewrite_var; | 932 v->get_handler = ngx_http_rewrite_var; |
940 v->data = index; | 933 v->data = index; |
941 } | 934 } |
942 | 935 |
943 if (ngx_http_rewrite_value(cf, lcf, &value[2]) != NGX_CONF_OK) { | 936 if (ngx_http_rewrite_value(cf, lcf, &value[2]) != NGX_CONF_OK) { |