remove commas and spaces from the end of the string

ngx_atoi() is too strict and panics when it sees any non-numeric character