vozlt / nginx-module-vts

Nginx virtual host traffic status module
BSD 2-Clause "Simplified" License
3.17k stars 456 forks source link

VTS doesn't support query string encoding #279

Open vultj opened 9 months ago

vultj commented 9 months ago

If query strings are "encoded", * is turned into %2A. This is not supported by vts, see below:

# curl '127.0.0.1:9001/status/control?cmd=reset&group=%2A'
{"processingReturn":false,"processingCommandString":"reset","processingGroupString":"%2A","processingZoneString":"","processingCounts":0}
# curl '127.0.0.1:9001/status/control?cmd=reset&group=*'
{"processingReturn":true,"processingCommandString":"reset","processingGroupString":"*","processingZoneString":"","processingCounts":8}
u5surf commented 9 months ago

@vultj Thanks reporting.

Indeed, although it seems to be a some kind of specification because the other characters (e.g. @) does not support escaping and it should restrict to display the data properly. We'll consider whether it has a validity to add the rule of escaped character by confirming the other usecase or the another nginx's modules.

https://github.com/vozlt/nginx-module-vts/blob/bd338835463811fe0221db858d865269952aaed9/src/ngx_http_vhost_traffic_status_display.c#L126-L160

Moreover, could you tell me what specifically do you have trouble with? I wanna know by what had been escaped the query string.