| 1989 | } |
| 1990 | |
| 1991 | WebRequest::Result WebRequestWinHTTP::InitializeAuthIfNeeded() |
| 1992 | { |
| 1993 | std::int32_t status = _response->GetStatus(); |
| 1994 | if (status == HTTP_STATUS_DENIED || status == HTTP_STATUS_PROXY_AUTH_REQ) { |
| 1995 | _authChallenge.reset(new WebAuthChallengeWinHTTP( |
| 1996 | status == HTTP_STATUS_PROXY_AUTH_REQ |
| 1997 | ? WebAuthChallenge::Source::Proxy |
| 1998 | : WebAuthChallenge::Source::Server, |
| 1999 | *this)); |
| 2000 | |
| 2001 | if (!_authChallenge->Initialize()) { |
| 2002 | return FailWithLastError("Initializing authentication challenge"_s); |
| 2003 | } |
| 2004 | |
| 2005 | return Result::Unauthorized(_response->GetStatusText()); |
| 2006 | } |
| 2007 | |
| 2008 | return Result::Ok(); |
| 2009 | } |
| 2010 | |
| 2011 | const char* __GetWin32ErrorSuffix(DWORD error); |
| 2012 |
nothing calls this directly
no test coverage detected