MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / findBasicAuthChallenge

Method findBasicAuthChallenge

Libraries/HttpClient/HttpClientSession.cpp:789–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

787}
788
789bool SC::HttpClientSession::findBasicAuthChallenge(const HttpClientResponse& response,
790 HttpClientSessionAuthChallenge::Target target,
791 HttpClientSessionAuthChallenge& challenge)
792{
793 challenge = HttpClientSessionAuthChallenge();
794 challenge.target = target;
795
796 const StringSpan headerName = target == HttpClientSessionAuthChallenge::Proxy ? StringSpan("Proxy-Authenticate")
797 : StringSpan("WWW-Authenticate");
798
799 HttpClientResponseHeaderIterator iterator;
800 StringSpan value;
801 while (response.findNextHeader(headerName, iterator, value))
802 {
803 if (findBasicChallengeInValue(value, target, challenge))
804 {
805 return true;
806 }
807 }
808 return false;
809}
810
811SC::Result SC::HttpClientSession::makeBasicAuthorizationForChallenge(const HttpClientResponse& response,
812 HttpClientSessionAuthChallenge::Target target,

Callers

nothing calls this directly

Calls 3

StringSpanFunction · 0.85
findNextHeaderMethod · 0.80

Tested by

no test coverage detected