Welcome! Log In Create A New Profile

Advanced

[PATCH] Making $invalid_referer accessible in Perl (and Lua)

agentzh
May 21, 2013 07:30PM
Hello!

The $invalid_referer variable is always created with the
NGX_HTTP_VAR_NOHASH flag in ngx_http_referer_module, which
unfortunately prohibits its use in embedded dynamic languages like
Perl and Lua (through the ngx_http_get_variable function).

Below attaches a patch that removes this flag.

This issue was originally reported by Fry-kun.

Thanks!
-agentzh

--- nginx-1.5.0/src/http/modules/ngx_http_referer_module.c 2013-05-06
03:27:10.000000000 -0700
+++ nginx-1.5.0-patched/src/http/modules/ngx_http_referer_module.c
2013-05-21 16:04:49.340286168 -0700
@@ -396,8 +396,7 @@ ngx_http_valid_referers(ngx_conf_t *cf,

ngx_str_set(&name, "invalid_referer");

- var = ngx_http_add_variable(cf, &name,
- NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOHASH);
+ var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE);
if (var == NULL) {
return NGX_CONF_ERROR;
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Making $invalid_referer accessible in Perl (and Lua) Attachments

agentzh 1422 May 21, 2013 07:30PM

Re: [PATCH] Making $invalid_referer accessible in Perl (and Lua)

Maxim Dounin 506 May 22, 2013 02:56PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 303
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready