A WWW-Authenticate header must be present in the 401 response to make clients know that they can authenticate, and how.
WWW-Authenticate: Basic realm="jsonrpc"
Should fix #7462.
20 | @@ -21,6 +21,9 @@ 21 | #include <boost/algorithm/string.hpp> // boost::trim 22 | #include <boost/foreach.hpp> //BOOST_FOREACH 23 | 24 | +/** WWW-Authenticate to present with 401 Unauthorized response */ 25 | +static const char *WWW_AUTH_HEADER_DATA = "Basic realm=\"jsonrpc\"";
Nit:
diff --git a/src/httprpc.cpp b/src/httprpc.cpp
index 5d54d8f..a447a3e 100644
--- a/src/httprpc.cpp
+++ b/src/httprpc.cpp
@@ -25 +25 @@
-static const char *WWW_AUTH_HEADER_DATA = "Basic realm=\"jsonrpc\"";
+static const char* WWW_AUTH_HEADER_DATA = "Basic realm=\"jsonrpc\"";
@@ -157 +157 @@ static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &)
- req->WriteHeader("WWW-Authenticate",WWW_AUTH_HEADER_DATA);
+ req->WriteHeader("WWW-Authenticate", WWW_AUTH_HEADER_DATA);
@@ -170 +170 @@ static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &)
- req->WriteHeader("WWW-Authenticate",WWW_AUTH_HEADER_DATA);
+ req->WriteHeader("WWW-Authenticate", WWW_AUTH_HEADER_DATA);
Concept ACK 5bac0a9
A WWW-Authenticate header must be present in the 401
response to make clients know that they can authenticate,
and how.
WWW-Authenticate: Basic realm="jsonrpc"
Fixes #7462.Cherry-picked to 0.12 as b2f2b85ad5f3456c0a14f36602122d393f01f7fe