linkcheck.httputil

Functions

asn1_generaltime_to_seconds(timestr)

The given string has one of the following formats YYYYMMDDhhmmssZ YYYYMMDDhhmmss+hhmm YYYYMMDDhhmmss-hhmm

encode_base64(s)

Encode given string in base64, excluding trailing newlines.

get_content_type(headers)

Get the MIME type from the Content-Type header value, or ‘application/octet-stream’ if not found.

x509_to_dict(x509)

Parse a x509 pyopenssl object to a dictionary with keys subject, subjectAltName and optional notAfter.

linkcheck.httputil.asn1_generaltime_to_seconds(timestr)[source]

The given string has one of the following formats YYYYMMDDhhmmssZ YYYYMMDDhhmmss+hhmm YYYYMMDDhhmmss-hhmm

Returns

a datetime object or None on error

linkcheck.httputil.encode_base64(s)[source]

Encode given string in base64, excluding trailing newlines.

linkcheck.httputil.get_content_type(headers)[source]

Get the MIME type from the Content-Type header value, or ‘application/octet-stream’ if not found.

Returns

MIME type

Return type

string

linkcheck.httputil.x509_to_dict(x509)[source]

Parse a x509 pyopenssl object to a dictionary with keys subject, subjectAltName and optional notAfter.