Middleware are not always applied when running specs.
…prevent silent failures
E.g. the example given under http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 has a space after the comma
We need to look for the longest matching prefix rather than just the first language with the same basic language code, otherwise if we have both zh-CN and zh-TW available then we may select the wrong one as we will return he first one we see that starts with zh even if the user had said they preferred a specific variant.