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

HttpServletResponse::sendRedirect(String) broken in JSPs (EE10) #321

Open
MuffinTheMan opened this issue Dec 10, 2024 · 3 comments
Open
Assignees

Comments

@MuffinTheMan
Copy link
Contributor

I believe we found another bug while testing our upgrade to EE10 (Java 21) on App Engine Standard.

If we attempt a redirect from a JSP (via HttpServletResponse::sendRedirect(String) like response.sendRedirect("/some-path");), it works properly locally but crashes when running via our deployed App Engine application (with an error like: Request failed: Unexpected Error: java.io.IOException: written 2 > 0 content-length). When sending a redirect from a non-JSP HttpServlet, there are no issues; so it appears to be an issue specific to handling redirects from JSPs.

This can be reproduced with my sample web app: https://github.com/MuffinTheMan/appengine-standard-ee10-sample/tree/3-redirects (see the README.md for instructions--I have been testing with a custom runtime built from this commit: 0f190e8 due to #316).

From the README:

Broken

  • Navigate to /redirect-test
    • Local App: redirected to /jsp
    • Deployed App: the browser displays an error like Request failed: Unexpected Error: java.io.IOException: written 2 > 0 content-length

Working

  • Navigate to /redirect
    • Local App: redirected to /jsp
    • Deployed App: redirected to /jsp
@ludoch
Copy link
Collaborator

ludoch commented Dec 10, 2024

I assume the runtime code used is from head, right?

@MuffinTheMan
Copy link
Contributor Author

@ludoch the latest commit in my local version from which I had built the jars was 0f190e8

However, I just checked out the latest appengine-java-standard:main and built new jars to test. Same issue with the latest.

@lachlan-roberts
Copy link
Collaborator

I think this is a bug in Jetty 12 EE10, I will open a PR to fix.

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

No branches or pull requests

3 participants