Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detecting MobileSafari/604.1 CFNetwork/1121.2.2 Darwin/19.3.0 as "unknown" #131

Open
brookback opened this issue Feb 6, 2020 · 3 comments
Assignees

Comments

@brookback
Copy link

Hi! Thanks for a great package! πŸ’›

We're seeing this UA string in our logs:

MobileSafari/604.1 CFNetwork/1121.2.2 Darwin/19.3.0

I couldn't find that in past issues – any chance it can be detected as ios or ios-webview or similar? It doesn't seem like #67 is covering this UA string.

I found this on SO: https://stackoverflow.com/questions/24464883/serverhttp-user-agent-changing-on-safari-ios. It suggests:

The CFNetwork user agent is only a crawler process of the mobile safari. This will retrieve fav or touch icons. The CFNetwork requests depends on the iOS or Mac OS X version, the first token only identify the APP.

So this might be a no-op, depending on the goal of this module. But it'd be nice to have it identified somehow.

@DamonOehlman
Copy link
Owner

@brookback Thanks for the report mate, and apologies for the delay in responding. I'll take a look at getting this regex in shortly.

@DamonOehlman DamonOehlman self-assigned this Feb 26, 2020
@DamonOehlman
Copy link
Owner

Just prepping a PR for this now, and having a look at the options for the return type, it feels like this is most appropriately treated as a bot-device return type (it seems to be a bot simulating a device). Is that correct?

I'm thinking that the result type would look something like this (see recent changes on master re including a type disciminator):

{
  type: 'bot-device',
  name: 'ios',
  version: '604.1',
  os: 'Mac OS',
  bot: 'CFNetwork'
}

Does that seem right to you?

@brookback
Copy link
Author

it feels like this is most appropriately treated as a bot-device return type (it seems to be a bot simulating a device). Is that correct?

Yea, I'd say so too. It's not a user controlling this request.

Type looks cool! Two things:

  • The name prop could probably be more specific, like ios-crawler, ios-safari-crawler, or similar.
  • The os: "Mac OS" prop seems like it's lying a bit – the bot is clearly MobileSafari, so it could be ios?

Thanks for quick turnaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants