https_server.py
def check_for_headless_browsers(request):
    """Given a UA string, determines if the request came from a headless
    browser.

    Args:
        request (:obj: `str`) UA string or full HTTP request to parse for
            headless browsers

    Returns:
        (:obj: `re`) regex object that is parseable if a match for a headless
            browser is found, None otherwise
    """

    # performs the regex matching
    # starts with curl
    match_obj = re.search(CURL_RE, request)
    # if not curl, then tries wget
    if match_obj is None:
        match_obj = re.search(WGET_RE, request)
    # if not wget, then tries requests module
    if match_obj is None:
        match_obj = re.search(REQUESTS_RE, request)
    # if not requests, then tries powershell
    if match_obj is None:
        match_obj = re.search(POWERSHELL_RE, request)
    # if not powershell, then tries Go
    if match_obj is None:
        match_obj = re.search(GO_RE, request)

    if match_obj is not None:
        return match_obj.group()

    return None
Given a UA string, determines if the request came from a headless
    browser.

    Args:
        request (:obj: `str`) UA string or full HTTP request to parse for
            headless browsers

    Returns:
        (:obj: `re`) regex object that is parseable if a match for a headless
            browser is found, None otherwise
    
Given a UA string, determines if the request came from a headless
browser.
Given a UA string determines if the request came from a headless browser .
def check_for_headless_browsers(request):
    match_obj = re.search(CURL_RE, request)
    if match_obj is None:
        match_obj = re.search(WGET_RE, request)
    if match_obj is None:
        match_obj = re.search(REQUESTS_RE, request)
    if match_obj is None:
        match_obj = re.search(POWERSHELL_RE, request)
    if match_obj is None:
        match_obj = re.search(GO_RE, request)
    if match_obj is not None:
        return match_obj.group()
    return None
def check_for_headless_browsers ( request ) : match_obj = re . search ( CURL_RE , request ) if match_obj is None : match_obj = re . search ( WGET_RE , request ) if match_obj is None : match_obj = re . search ( REQUESTS_RE , request ) if match_obj is None : match_obj = re . search ( POWERSHELL_RE , request ) if match_obj is None : match_obj = re . search ( GO_RE , request ) if match_obj is not None : return match_obj . group ( ) return None
Given a UA string, determines if the request came from a headless
browser.
Given a UA string determines if the request came from a headless browser .
"""Given a UA string, determines if the request came from a headless
    browser.

    Args:
        request (:obj: `str`) UA string or full HTTP request to parse for
            headless browsers

    Returns:
        (:obj: `re`) regex object that is parseable if a match for a headless
            browser is found, None otherwise
    """ # performs the regex matching # starts with curl # if not curl, then tries wget # if not wget, then tries requests module # if not requests, then tries powershell # if not powershell, then tries Go
`re`) regex object that is parseable if a match for a headless
browser is found, None otherwise
` re ` ) regex object that is parseable if a match for a headless browser is found None otherwise
(
request
request (
`str`) UA string or full HTTP request to parse for
headless browsers
` str ` ) UA string or full HTTP request to parse for headless browsers