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

Merged
merged 1 commit into from
Jul 3, 2025

Conversation

DeepDhamala
Copy link
Contributor

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
@jzheaux jzheaux self-assigned this Jul 3, 2025
@jzheaux jzheaux added in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 3, 2025
@jzheaux jzheaux added this to the 7.0.0-M1 milestone Jul 3, 2025
@jzheaux jzheaux merged commit 081c92a into spring-projects:main Jul 3, 2025
6 checks passed
@jzheaux
Copy link
Contributor

jzheaux commented Jul 3, 2025

Thanks, @DeepDhamala! This is now merged into main.

@DeepDhamala
Copy link
Contributor Author

Thanks for merging it! Glad to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong logging for CsrfFilter in trace level
3 participants