Better handling of HTTP Basic Authentication