gavinchou commented on code in PR #66745:
URL: https://github.com/apache/doris/pull/66745#discussion_r3776872553


##########
be/src/service/http/http_request.cpp:
##########
@@ -44,6 +45,34 @@ static bool is_sensitive_header(const std::string& 
header_name) {
            iequal(header_name, HttpHeaders::AUTH_TOKEN);
 }
 
+// Renders a sensitive header for logging. For HTTP Basic credentials the user 
name is kept,
+// so that logs still answer "who issued this request", and only the password 
is masked,
+// yielding "<user>:***MASKED***". Any other sensitive header, and any 
credential we fail to
+// parse, is masked as a whole. The result is a rendering, not the header 
value: the real one
+// is base64 encoded.
+static std::string mask_sensitive_header(const std::string& name, const 
std::string& value) {

Review Comment:
   add an UT?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to