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

Closed
spring-issuemaster opened this issue May 23, 2018 · 2 comments
Closed
Assignees

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented May 23, 2018

chen opened SPR-16865 and commented

my code(use apache shiro)

!image-2018-05-23-16-50-20-505.png!

headers Info

!image-2018-05-23-16-51-17-444.png!

view in chrome

!image-2018-05-23-16-54-26-465.png!

this problem lead to we can't test after login


Affects: 5.0.6

Attachments:

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster 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?

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.