shon/httpagentparser — pull request #29 by nigelmcnie (2012-11-16 00:52:53+00:00)
Title: Prefer the first occurrence of the product string in getVersion.

According to the spec [0], the first occurrence of the product string
should be favoured when determining the actual product version. The
existing implementation favoured the last one, which broke on UAs like
this:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0;
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET
CLR 2.0.50727; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618;
.NET4.0C)

Which is actually MSIE8, not MSIE6.

Fixed a test case that looks like it was broken with this very issue
while I was in the area, and added the one I was having problems with.

[0] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43