[dev] more permissive ngx_http_variables_init_vars

Manlio Perillo manlio_perillo at libero.it
Fri Jan 11 18:13:36 MSK 2008


Hi.

I have written a module that make available some "undeclared" variables, 
using the same method used for `http_`, `sent_http_` and 
`upstream_http_` variables.

These variables have prefix `cookie_` and `args_`.
As an example:
   $cookie_name
returns the value of the cookied named "name".

Unfortunately, my module does not works without a patch to nginx (the 
patch is attached.

The patch is very simple: instead of returning an error when an "unknow" 
variable is seen, it first checks if it has a get_handler attached.

These variables are still "second class citizen", since they are not 
supported by the `ngx_http_get_variable` function (this function is
used by the SSI module, and may be used by a perl handler).

This is not a problem; moreover I can add directives for explicitly 
declare these variables:
   parsed_cookie_set name;
will add the `cookie_name` variable.


Igor, what I would like to know is if the patch is correct and if it is 
possible to have it integrated in nginx.



Thanks  Manlio Perillo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ngx_http_parsed_variables.patch
Type: text/x-patch
Size: 390 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx/attachments/20080111/3ccc003e/attachment.bin>


More information about the nginx mailing list