amites/mezzanine — comment on commit 58ed2a5dfdce9c39639b85020f944735f227e988
File:  line 0
By stephenmcd:

Line 14 isn't a user agent string, it's the device name which are keys in the dict setting DEVICE_USER_AGENT, eg "mobile", "tablet", etc.

It makes sense to normalize the user agent strings in case there's a variation from a browser where the casing doesn't match - but the device names are entirely controlled by the developer. If he/she sets one up with uppercase chars in it, the change on line 14 will break it.