Skip to content

Commit

Permalink
Keep the initial header name after the bearer token log formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mpatrascoiu committed Mar 22, 2024
1 parent 6a4fa41 commit b3bce9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/curl/StandaloneCurlRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ static std::string filterAuthorizationHeader(const std::string& line) {
if (getenv("DAVIX_FORMAT_BEARER_TOKEN") != NULL) {
std::string content = line.substr(pos + 15);

// Print "Authorization: Bearer abcdefg...tuvwxyz"
// Format into "<header>: Bearer abcdefg...tuvwxyz"
if ((content.find("Bearer ") == 0) && (content.size() > 100)) {
filtered = "Authorization: Bearer " + content.substr(7, 7) + "..." + content.substr(content.size() - 7);
filtered = line.substr(0, pos + 15) + "Bearer " + content.substr(7, 7) + "..." + content.substr(content.size() - 7);
formatted = true;
}
}
Expand Down

0 comments on commit b3bce9d

Please sign in to comment.