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

Test Gzip + JSP #4520

Merged
merged 4 commits into from
Jul 16, 2020
Merged

Test Gzip + JSP #4520

merged 4 commits into from
Jul 16, 2020

Conversation

jbescos
Copy link
Member

@jbescos jbescos commented Jun 23, 2020

Adding a new example that tests JSP is GZipped with no issues.

Recently an issue was found in one servlet container, and this demonstrates the issue is not related to jersey.

@jbescos
Copy link
Member Author

jbescos commented Jun 25, 2020

I have to move it to servlet 4.x because 2.5 is going to be deprecated.

Signed-off-by: Jorge Bescos Gascon <[email protected]>
@jbescos
Copy link
Member Author

jbescos commented Jun 26, 2020

@senivam @jansupol what is your opinion on the commit:
7676148

I found that in Weblogic, after the method HttpServletResponse#flushBuffer is invoked, it will refuse to add new headers in the response. It is possible that in other Servlet implementations it behaves similar. It is not the case of Jetty because I tested it is fine.

I think it is possible to fix it in Weblogic instead of Jersey but probably it makes more sense to do this in Jersey because other implementations could also make problems. Let me know if you think in other way.

Signed-off-by: Jorge Bescos Gascon <[email protected]>
@senivam
Copy link
Contributor

senivam commented Jun 29, 2020

@jbescos - just a question - why you do not use flush() method of the PrintWriter which actually wraps responseStream?

@jbescos
Copy link
Member Author

jbescos commented Jun 29, 2020

@jbescos - just a question - why you do not use flush() method of the PrintWriter which actually wraps responseStream?

I already tried it, but the problem is Weblogic creates internally a ServletOutputStream that wraps the original (weblogic.servlet.internal.ServletOutputStreamImpl). This wrapper will not accept more headers after flush.

Then when ServletOutputStream#flush is executed, it is too late and it reach the status of not accepting more headers.

Signed-off-by: Jorge Bescos Gascon <[email protected]>
Copy link
Contributor

@senivam senivam left a comment

Choose a reason for hiding this comment

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

LGTM

@senivam senivam requested a review from Verdent July 13, 2020 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants