Permalink
Browse files

Merge pull request #376 from erundook/patch-1

fix agent detection bug: TypeError: Object Mac OS X 10.8.2 has no method 'match'
  • Loading branch information...
2 parents 02bd0b9 + 1651cb0 commit a6a6bd9fa9d83d9b7311ec3c7e2c58b7f94c8d1f @lancejpollard lancejpollard committed Jan 12, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 packages/tower-middleware/server/agent.coffee
View
6 packages/tower-middleware/server/agent.coffee
@@ -9,9 +9,9 @@ Tower.MiddlewareAgent = (request, response, next) ->
version: agent.toVersion()
os: agent.os
name: agent.toAgent()
- mac: !!agent.os.match(/mac/i)
- windows: !!agent.os.match(/win/i)
- linux: !!agent.os.match(/linux/i)
+ mac: !!agent.os.family.match(/mac/i)
+ windows: !!agent.os.family.match(/win/i)
+ linux: !!agent.os.family.match(/linux/i)
request.agent = new Tower.NetAgent(attributes)

0 comments on commit a6a6bd9

Please sign in to comment.