erlyaws / yaws

Yaws webserver
https://erlyaws.github.io
BSD 3-Clause "New" or "Revised" License
1.28k stars 267 forks source link

yaws_api:filter_parse/3 bug #324

Closed leoliu closed 6 years ago

leoliu commented 6 years ago

The function says return a list of values but erroneously return a tuple. Could someone take a look and also consider if returning {ok, Vs} is better than Vs? Thanks.

vinoski commented 6 years ago

Clearly, the code returns either a tuple or undefined, and this has been true for a long time — I traced the list_to_tuple call back over a decade, and the comment and the list_to_tuple call have been there together for quite awhile. Changing the return value now would likely break user code, so I won't change that, but I'll change the comment.

leoliu commented 6 years ago

Thanks for the clarification.

Come to think about it more returning a list here would make it indistinguishable to single value.