Fix 'Call to a member function __getWWWAuthenticateString() on a non-object' when getting authentication method for a HTTP 401 response