cisagov / trustymail_reporter

Generate Trustworthy Email reports based on scan data
Creative Commons Zero v1.0 Universal
10 stars 4 forks source link

Handle the case where the domain or header domain is malformed #64

Closed jsf9k closed 2 years ago

jsf9k commented 2 years ago

๐Ÿ—ฃ Description

This pull requests modifies the code to handle the case where the domain or header domain is malformed.

๐Ÿ’ญ Motivation and context

There was a case this past weekend where an HHS header domain was malformed such that the get_public_suffix() call failed because it was being passed a domain of None. With these changes the code will handle such cases without crashing and will print out a helpful logging message.

๐Ÿงช Testing

All pre-commit hooks pass. I also used these changes to successfully generate the HHS report from this past weekend.

โœ… Pre-approval checklist

โœ… Post-merge checklist