extend/cowboy — pull request #91 by csrl (2011-11-22 05:55:59+00:00)
Title: The path handling doesn't differentiate between /resource and /resource/

It is necessary to be able to handle URI paths ending in '/'. Currently, the cowboy implementation explicitly strips this ability for some reason. In cowboy_dispatcher:do_split_path/2, it calls binary:split/3 with the 'trim' option. Removing the 'trim' option fixes this problem, allowing to return an empty <<>> binary at the end of the path when the path ends in '/'.

With this change, one can correctly route paths that work like:

<<"/">> => [<<>>]
<<"/resource">> => [<<"resource">>]
<<"/resource/">> => [<<"resource">>,<<>>]
<<"/resource/sub">> => [<<"resource">>,<<"sub">>]