Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#182 closed defect (fixed)

map with hostnames does not drop terminating dot

Reported by: www.google.com/accounts/o8/id?id=AItOawnQxODTko53PmY0va90aNN76a_jMUVqVco Owned by: somebody
Priority: minor Milestone: 1.3
Component: nginx-module Version: 1.3.x
Keywords: map hostnames Cc:
uname -a: not important
nginx -V: at least 1.2.1 and CURRENT

Description

In ngx_http_map_variable function of ngx_http_map_module.c there are lines:
124 len = val.len;
125
126 if (len && map->hostnames && val.data[len - 1] == '.') {
127 len--;
128 }
129
130 value = ngx_http_map_find(r, &map->map, &val);

But 'len' is not used after that, so terminating dot cannot be ignored for map with hostnames as it should.

Change History (3)

comment:1 by Maxim Dounin, 12 years ago

Status: newaccepted

Thank you for report. Actually, the code is dead since introduction in 0.3.16, due to map->hostnames being always set to 0.

comment:2 by Ruslan Ermilov, 12 years ago

Resolution: fixed
Status: acceptedclosed

In [4713/nginx]:

map: strip final dot before looking up in a map of hostnames.
(closes #182)

comment:3 by Maxim Dounin, 12 years ago

In 4786/nginx:

Merge of r4713: map hostnames fix (ticket #182).

The final dot wasn't stripped before looking up in a map of hostnames.

Note: See TracTickets for help on using tickets.