Skip to content
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

MvcResult-->mockResponse-->headers will lose a apart of headers [SPR-16865] #21404

spring-projects-issues opened this issue May 23, 2018 · 2 comments


Copy link

@spring-projects-issues spring-projects-issues commented May 23, 2018

chen opened SPR-16865 and commented

my code(use apache shiro)


headers Info


view in chrome


this problem lead to we can't test after login

Affects: 5.0.6


Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented May 23, 2018

Rossen Stoyanchev commented

MockMvc runs with a mock request and response, and without a server. The most likely explanation is the mock response reflects only what was actually added. Why do you think it's "losing" headers, and how would it actually lose them?

By contrast at runtime, an application may have extra configuration (e.g. extra filters), which may add headers, the server itself may add headers, and any proxies in between client and server may also add headers.

So differences with a response from a browser are expected. Which headers exactly are causing you an issue? Can you show how MockMvc is set up?


Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented May 24, 2018

chen commented

I want get JSESSIONID。  I have misunderstood the mock。

please close this issue.

sorry for bothering you


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants