-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
ResponseStatusException no longer returning response body in 2.6.2 using Spring Security when application has a custom context path #29299
Comments
@BATON35 The repository to which you've linked doesn't appear to reproduce the problem you've described. For example, as far as I can tell, it doesn't use Spring Security. Can you please clarify? |
@wilkinsona I am sorry. I forgot to update the repository. Now you can reproduce the problem. |
I'm unable to replicate the problem with the sample. If I change the parent POM to
@BATON35 Can you please update your sample to use Spring Boot 2.6.2 and provide detailed instructions on how we can replicate the problem. |
@philwebb @wilkinsona I see the same behaviour in our application for HTTP I put a small example together where the problem can be reproduced: https://github.com/lgraf/error-page-example The example contains two tests that call a secured rest endpoint and can be used to reproduce the issue.
The security configuration contains an explicit The tests fail with spring-boot Additional observations As noted in a comment of #28953.
Not sure if it the root cause of the issue, but if i remove the context-path configuration for the application, the test passes also with spring-boot |
This issue is still not fully resolved. The good new is that 3460c24 makes adding Why is the |
@datagitlies Sorry that you're still having problems here. It's hard to say what's happening without seeing a complete example of the problem that you're facing. There are some forthcoming changes in Spring Security that may help here. I tried to describe them in this issue comment. I can't be certain that they'll help as I don't feel that I fully understand your problem. Perhaps you can try the Spring Security snapshot and, if that doesn't help, create a new issue with a minimal sample that reproduces your problem. |
Thanks @wilkinsona - I tried using spring-security |
@datagitlies My guess is that you're using a |
@BATON35 hey how to remove the path from that exception message. |
Referring to bug #28953 the problem has not been solved.
No status in response body for 401.
Example project:
https://github.com/BATON35/spring-boot-custom-error-handling.git
Response from postman for springBoot 2.6.2:
Response from postman for springBoot 2.5.x
The text was updated successfully, but these errors were encountered: