Add support for middlewares with hyphens

Change-Id: I1142270f76285190b600da759753011331a85909
Closes-bug: #1278950
Merge "Add support for middlewares with hyphens"