Possible rewrite regular expression bug?

Peter Hoang lists at ruby-forum.com
Wed Jun 25 22:57:03 MSD 2008


The escape_uri function is called in 3 different places in 
ngx_http_script.c:

1) size_t ngx_http_script_copy_capture_len_code(ngx_http_script_engine_t 
*e)
2) void ngx_http_script_copy_capture_code(ngx_http_script_engine_t *e)
3) void ngx_http_script_regex_start_code(ngx_http_script_engine_t *e)

If I were to add "ne" flag as following:

rewrite ^/search /search/q-$q.html last ne;

I could do check for ngx_strcmp(value[4].data, "ne") == 0 in 
ngx_http_rewrite and store the flag somewhere. My question is, how do we 
store this flag so that we can retrieve it in 3 above functions? Can I 
just create an additional flag in ngx_http_script_engine_t to do this?


As for the redirect decoding, what is the effect of commenting the 
following line in ngx_http_script.c:

       /* ngx_unescape_uri(&dst, &src, e->pos - e->buf.data,
                         NGX_UNESCAPE_REDIRECT); */

Thanks in advance.

Cheers,
Peter

-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list