Skip to content

Commit

Permalink
fix: RBAC requests without headers fail to be logged (#3170)
Browse files Browse the repository at this point in the history
There are certain failing RBAC requests which do not have headers, and
when we try to log them, the code throws an exception because of course
the map of requests is null, and we can't access its elements.

RHCLOUD-36553
  • Loading branch information
MikelAlejoBR authored Dec 4, 2024
1 parent 2e7ac56 commit 86ecbea
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ public void filter(final ClientRequestContext requestContext, final ClientRespon
* {@code {header1=value1, header2=[value2, value3]}}.
*/
private String headersToString(final MultivaluedMap<String, String> headers) {
if (headers == null || headers.isEmpty()) {
return "";
}

final StringBuilder sb = new StringBuilder();
for (final Map.Entry<String, List<String>> entry : headers.entrySet()) {
sb.append(entry.getKey());
Expand Down

0 comments on commit 86ecbea

Please sign in to comment.