@@ -4239,14 +4239,16 @@ inline std::pair<std::string, std::string> make_digest_authentication_header(
42394239 }
42404240 }
42414241
4242- auto field =
4243- " Digest username=\" " + username + " \" , realm=\" " + auth.at (" realm" ) +
4244- " \" , nonce=\" " + auth.at (" nonce" ) + " \" , uri=\" " + req.path +
4245- " \" , algorithm=" + algo +
4246- (qop.empty () ? " , response=\" "
4247- : " , qop=" + qop + " , nc=\" " + nc + " \" , cnonce=\" " +
4248- cnonce + " \" , response=\" " ) +
4249- response + " \" " ;
4242+ auto opaque = (auth.find (" opaque" ) != auth.end ()) ? auth.at (" opaque" ) : " " ;
4243+
4244+ auto field = " Digest username=\" " + username + " \" , realm=\" " +
4245+ auth.at (" realm" ) + " \" , nonce=\" " + auth.at (" nonce" ) +
4246+ " \" , uri=\" " + req.path + " \" , algorithm=" + algo +
4247+ (qop.empty () ? " , response=\" "
4248+ : " , qop=" + qop + " , nc=" + nc + " , cnonce=\" " +
4249+ cnonce + " \" , response=\" " ) +
4250+ response + " \" " +
4251+ (opaque.empty () ? " " : " , opaque=\" " + opaque + " \" " );
42504252
42514253 auto key = is_proxy ? " Proxy-Authorization" : " Authorization" ;
42524254 return std::make_pair (key, field);
0 commit comments