3rd-Eden / useragent

Useragent parser for Node.js, ported from browserscope.org
MIT License
897 stars 137 forks source link

RFC 7231 and/or Alamofire support #102

Open spencerhakim opened 7 years ago

spencerhakim commented 7 years ago

Alamofire generates a default User-Agent in the form of iOS-Example/1.0 (com.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0. It's valid according to the RFC, so I'm guessing this might be more an issue of this library not fully supporting the RFC? Falling back to "Other/0.0.0" really isn't correct in this situation.

> ua.parse("iOS-Example/1.0 (com.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0")
Agent {
  family: 'Other',
  major: '0',
  minor: '0',
  patch: '0',
  source: 'iOS-Example/1.0 (com.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0' }

> ua.is("iOS-Example/1.0 (com.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0")
{ chrome: false,
  firefox: false,
  ie: false,
  mobile_safari: false,
  mozilla: false,
  opera: false,
  safari: false,
  webkit: false,
  android: false,
  version: '0' }