Adds ability to use funs in cowboy middleware