Skip to content

Improve logging clarity in CsrfFilter #17425

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DeepDhamala
Copy link

Update toString() method in DefaultRequiresCsrfMatcher to better reflect its logic during trace-level logging.

The current log message was ambiguous:
"Did not protect against CSRF since request did not match CsrfNotRequired [TRACE, HEAD, GET, OPTIONS]"

Now it clearly shows:
"Did not protect against CSRF since request did not match IsNotHttpMethod [TRACE, HEAD, GET, OPTIONS]"

Closes gh-17250

Update toString() method in DefaultRequiresCsrfMatcher to better reflect its logic during trace-level logging.

Closes spring-projectsgh-17250

Signed-off-by: Deep Dhamala <[email protected]>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong logging for CsrfFilter in trace level
2 participants