MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / InitializeAuthIfNeeded

Method InitializeAuthIfNeeded

Sources/Shared/IO/WebRequest.cpp:1991–2009  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

GetStatusMethod · 0.45
resetMethod · 0.45
InitializeMethod · 0.45
GetStatusTextMethod · 0.45

Tested by

no test coverage detected