-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guide @ServerFilter @FilterMethod guide #1408
Conversation
guides/micronaut-server-filter-request/java/src/test/java/example/micronaut/MemoryAppender.java
Outdated
Show resolved
Hide resolved
if (LOG.isTraceEnabled()) { | ||
HttpHeaders headers = request.getHeaders() | ||
for (String headerName : headers.names()) { | ||
if (headerName.equalsIgnoreCase(HttpHeaders.AUTHORIZATION)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure we should be encouraging unsafe patterns like this, how do you know what other headers might contain sensitive values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you prefer if I remove the part where we skip logging the Authorization header and instead log every HTTP header in the guide?
I think showing users to be careful about what they log is better than logging everything.
Please note that in core, we skip logging some headers. Of course, what header is sensitive is application specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps you could use HeaderUtils
since it already does some masking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.