Skip to content

Update OncePerRequestFilter to match with spring-web #1657

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 2 commits into from
Jul 27, 2020

Conversation

bboyz269
Copy link
Contributor

Call "getAlreadyFilteredAttributeName()" instead of direct usage if private "this.alreadyFilteredAttributeName"

Fix the error of the property value is null when proxied by CGLIB (bean from extending SessionRepositoryFilter)

Copy link
Contributor

@eleftherias eleftherias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @bboyz269!

Could you add a test demonstrating the bug?

Also, please add Closes gh-1658 to the commit message, so that the issue you reported is automatically closed when this is merged.

@eleftherias eleftherias self-assigned this Jul 17, 2020
@eleftherias eleftherias added in: core type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 17, 2020
@bboyz269
Copy link
Contributor Author

bboyz269 commented Jul 17, 2020 via email

@rwinch
Copy link
Member

rwinch commented Jul 21, 2020

I think a unit test demonstrating that a subclass of OncePerRequestFilter that has overridden getAlreadyFilteredAttributeName will still work is sufficient.

Calling `this.alreadyFilteredAttributeName` with bean being proxied by Spring AOP cause NPE
@bboyz269
Copy link
Contributor Author

I think a unit test demonstrating that a subclass of OncePerRequestFilter that has overridden getAlreadyFilteredAttributeName will still work is sufficient.

Not quite, it has to be a subclass being proxied by Spring AOP.

@eleftherias I add a new test class OncePerRequestFilterAopTests, would you check it out?

@bboyz269 bboyz269 requested a review from eleftherias July 23, 2020 13:39
@eleftherias
Copy link
Contributor

Thanks for the updates @bboyz269!

In the original issue that you reported, gh-1658, was the class also being proxied by Spring AOP?

@bboyz269
Copy link
Contributor Author

In the original issue that you reported, gh-1658, was the class also being proxied by Spring AOP?

Yes, it was being proxied by Spring AOP with CGLIb.

Copy link
Contributor

@eleftherias eleftherias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification @bboyz269.
I just notice 2 small typos.
Once these are fixed, we can merge this PR.

@eleftherias eleftherias merged commit 5c05970 into spring-projects:master Jul 27, 2020
@eleftherias
Copy link
Contributor

Thanks for the PR @bboyz269! This is now merged into master.

@eleftherias eleftherias added this to the 2.4.0-RC1 milestone Jul 27, 2020
@eleftherias eleftherias added the status: duplicate A duplicate of another issue label Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: duplicate A duplicate of another issue type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants