Created
March 3, 2017 16:06
-
-
Save cbodley/9144f89eb25e869dd21aea51ceb13d0b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct crypt_sanitize_header { | |
boost::string_ref name; | |
boost::string_ref value; | |
crypt_sanitize_header(boost::string_ref name, boost::string_ref value) | |
: name(name), value(value) {} | |
}; | |
std::ostream& operator<<(std::ostream& out, const crypt_sanitize_header& h) { | |
out << h.name << '='; | |
if (conf->rgw_crypt_suppress_logs && | |
boost::algorithm::iequals(h.name, HTTP_X_AMZ_SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY)) { | |
out << "=key suppressed="; | |
} else { | |
out << h.value; | |
} | |
return out; | |
} | |
// example use: | |
dout(0) << crypt_sanitize_header{name, value} << dendl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment