Skip to content

Commit

Permalink
Merge 0a2e47e into 19b273c
Browse files Browse the repository at this point in the history
  • Loading branch information
konklone committed Dec 18, 2018
2 parents 19b273c + 0a2e47e commit 8f1bbcb
Show file tree
Hide file tree
Showing 5 changed files with 381 additions and 99 deletions.
2 changes: 1 addition & 1 deletion pshtt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.5.2'
__version__ = '0.6.0'
4 changes: 2 additions & 2 deletions pshtt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def to_csv(results, out_filename):
row = [result[header] for header in pshtt.HEADERS]
writer.writerow(row)

logging.warn("Wrote results to %s.", out_filename)
logging.warning("Wrote results to %s.", out_filename)


def to_json(results, out_filename):
Expand All @@ -62,7 +62,7 @@ def to_json(results, out_filename):
out_file.write(json_content + '\n')

if out_file is not sys.stdout:
logging.warn("Wrote results to %s.", out_filename)
logging.warning("Wrote results to %s.", out_filename)


def to_markdown(results, out_filename):
Expand Down
16 changes: 16 additions & 0 deletions pshtt/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ def __init__(self, protocol, host, base_domain):
self.headers = {} # will be replaced with a requests.structures.CaseInsensitiveDict
self.status = None
self.live = None
self.ip = None
self.redirect = None
self.server_header = None
self.server_version = None
self.unknown_error = False
self.notes = ""

# If an endpoint redirects, characterize the redirect behavior
self.redirect_immediately_to = None
Expand All @@ -55,7 +59,11 @@ def __init__(self, protocol, host, base_domain):
# Only HTTPS endpoints have these.
# Initialize all of them to None, so that it's
# discernible if they don't get explicitly set.
self.https_full_connection = None
self.https_client_auth_required = False
self.https_valid = None
self.https_public_trusted = None
self.https_custom_trusted = None
self.https_bad_chain = None
self.https_bad_hostname = None
self.https_expired_cert = None
Expand All @@ -81,6 +89,7 @@ def to_object(self):
'url': self.url,
'headers': dict(self.headers),
'status': self.status,
'ip': self.ip,
'live': self.live,
'redirect': self.redirect,
'redirect_eventually_to': self.redirect_eventually_to,
Expand All @@ -94,11 +103,18 @@ def to_object(self):
'redirect_eventually_to_http': self.redirect_eventually_to_http,
'redirect_eventually_to_external': self.redirect_eventually_to_external,
'redirect_eventually_to_subdomain': self.redirect_eventually_to_subdomain,
'server_header': self.server_header,
'server_version': self.server_version,
'notes': self.notes,
'unknown_error': self.unknown_error,
}

if self.protocol == "https":
obj['https_full_connection'] = self.https_full_connection
obj['https_client_auth_required'] = self.https_client_auth_required
obj['https_valid'] = self.https_valid
obj['https_public_trusted'] = self.https_public_trusted
obj['https_custom_trusted'] = self.https_custom_trusted
obj['https_bad_chain'] = self.https_bad_chain
obj['https_bad_hostname'] = self.https_bad_hostname
obj['https_expired_cert'] = self.https_expired_cert
Expand Down

0 comments on commit 8f1bbcb

Please sign in to comment.