Created
May 19, 2020 16:56
-
-
Save isocroft/f2d2f185052a77682a32de70490fb582 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** cURL - User Agent String Variations Regex in JS | |
* | |
* See: http://www.useragentstring.com/pages/useragentstring.php?name=cURL | |
* See: https://jonlabelle.com/snippets/view/yaml/browser-user-agent-regular-expressions | |
*/ | |
; /* Headless UserAgent(s) */ | |
const healessUAs = /\b(Windows-Update-Agent|Microsoft-CryptoAPI|SophosUpdateManager|SophosAgent|Debian APT-HTTP|Ubuntu APT-HTTP|libcurl-agent|libwww-perl|urlgrabber|curl|Wget|OpenBSD ftp|jupdate)(?:[ /](\d+)(?:\.(\d+)(?:\.(\d+))?)?)?/ | |
; /* cURL Headless UserAgent */ | |
const curlUA = /^curl\/((?:\d)\.(?:\d{1,2})(?:\.(?:\d|x))?) \((?:[\-_\w\.]+)\) libcurl(\/| )\1 \(?(?:(SSL|OpenSSL|NSS)\2(\d)\.(\d{1,2})\.\d([a-z]?)(\.\d)?)?\)?(?: (zlib\/(\d)\.(\d)\.(\d)|\(ipv6 enabled\)))?(?: (libidn\/(?:\d)\.(?:\d{1,2})))?(?: (libssh2\/(?:\d)\.(?:\d{1,2})))?$/i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment