Skip to content
This repository was archived by the owner on Dec 17, 2021. It is now read-only.
This repository was archived by the owner on Dec 17, 2021. It is now read-only.

Unnecessary prepending of "www." on domains of form "www#." #304

@obrien-j

Description

@obrien-j

We noticed recently that we were getting failures for domains with www[0-9]..

Case in point, www1.canada.ca, where pshtt, would recognize the relevant domains, but then sslyze was failing, as it was scanning www.www1.canada.ca

Relevent references to code below. Just curious if others had seen this behaviour, and had a better idea to fix then mine.

if utils.domain_uses_www(domain, cache_dir=cache_dir):

which calls
if domain.startswith("www."):

Suggest a basic change to drop the "." in the startswith condition.

# Check whether we have HTTP behavior data cached for a domain.
# If so, check if we know it canonically prepends 'www'.
def domain_uses_www(domain, cache_dir="./cache"):
    # Don't prepend www to www.
    if domain.startswith("www."):
        return False

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions