Skip to content

Commit

Permalink
Support python-requests
Browse files Browse the repository at this point in the history
  • Loading branch information
bayashi committed Mar 13, 2020
1 parent 7a37eca commit 892bb0b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/Duadua/Parser/HTTPClient/HTTPClient.pm
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ sub _python {
$h->{version} = $version if $version;
}
}
elsif ( index($d->ua, 'python-requests/') > -1 ) {
$h = {
name => 'python-requests',
};

if ($d->opt_version) {
my ($version) = ($d->ua =~ m!^python-requests/([\d.]+)!);
$h->{version} = $version if $version;
}
}

return $h;
}
Expand Down
9 changes: 9 additions & 0 deletions t/testset/http_client/http_clients.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,12 @@
is_windows: false
is_chromeos: false
version: '1.27'
- ua: 'python-requests/2.22.0'
name: 'python-requests'
is_bot: false
is_ios: false
is_android: false
is_linux: flase
is_windows: false
is_chromeos: false
version: '2.22.0'

0 comments on commit 892bb0b

Please sign in to comment.