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

User agent is not trimmed #9

Closed
COil opened this issue Sep 9, 2015 · 2 comments
Closed

User agent is not trimmed #9

COil opened this issue Sep 9, 2015 · 2 comments

Comments

@COil
Copy link
Contributor

COil commented Sep 9, 2015

When user agent is empty '', the bot "Aboutus" is reported. When the user agent is 1 space " " , the bot is not detected, shouldn’t the user be trimmed before calling the detect method ?

        $request->server->set('HTTP_USER_AGENT', '');
        dump($this->get('vipx_bot_detect.detector')->detectFromRequest($request));

        $request->server->set('HTTP_USER_AGENT', ' ');
        dump($this->get('vipx_bot_detect.detector')->detectFromRequest($request)); die();

Outputs:

Controller.php on line 91:
Metadata {#436 ▼
  -name: "AboutUs"
  -agent: ""
  -ip: null
  -type: "bot"
  -meta: array:1 [▶]
  -agentMatch: "exact"
}
Controller.php on line 94:
null
@lennerd
Copy link
Owner

lennerd commented Sep 9, 2015

Good catch. Would you like to make a PR for this?

@lennerd
Copy link
Owner

lennerd commented Sep 9, 2015

Btw. this should be an issue of the vipx-bot-detect package.

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