Returns the best match IP address from a given HTTP(s) header in Python