mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-10 09:43:51 +00:00
Fix #1166
This commit is contained in:
parent
33f53aa458
commit
b61f36579c
18
httplib.h
18
httplib.h
@ -4239,14 +4239,16 @@ inline std::pair<std::string, std::string> make_digest_authentication_header(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto field =
|
auto opaque = (auth.find("opaque") != auth.end()) ? auth.at("opaque") : "";
|
||||||
"Digest username=\"" + username + "\", realm=\"" + auth.at("realm") +
|
|
||||||
"\", nonce=\"" + auth.at("nonce") + "\", uri=\"" + req.path +
|
auto field = "Digest username=\"" + username + "\", realm=\"" +
|
||||||
"\", algorithm=" + algo +
|
auth.at("realm") + "\", nonce=\"" + auth.at("nonce") +
|
||||||
(qop.empty() ? ", response=\""
|
"\", uri=\"" + req.path + "\", algorithm=" + algo +
|
||||||
: ", qop=" + qop + ", nc=\"" + nc + "\", cnonce=\"" +
|
(qop.empty() ? ", response=\""
|
||||||
cnonce + "\", response=\"") +
|
: ", qop=" + qop + ", nc=" + nc + ", cnonce=\"" +
|
||||||
response + "\"";
|
cnonce + "\", response=\"") +
|
||||||
|
response + "\"" +
|
||||||
|
(opaque.empty() ? "" : ", opaque=\"" + opaque + "\"");
|
||||||
|
|
||||||
auto key = is_proxy ? "Proxy-Authorization" : "Authorization";
|
auto key = is_proxy ? "Proxy-Authorization" : "Authorization";
|
||||||
return std::make_pair(key, field);
|
return std::make_pair(key, field);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user