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

Issue when scrolling around in embedded videos #12792

Closed
mwalsh-etiometry opened this issue Feb 13, 2025 · 2 comments · Fixed by #12836
Closed

Issue when scrolling around in embedded videos #12792

mwalsh-etiometry opened this issue Feb 13, 2025 · 2 comments · Fixed by #12836
Assignees
Labels

Comments

@mwalsh-etiometry
Copy link

Jetty Version
Jetty 12.0.15 and 12.0.16

Jetty Environment
ee10

Java Version
openjdk 17.0.2

Question
When we upgraded from Jetty 11 to Jetty 12.0.15, the embedded videos in our application started throwing 416 errors. Upon looking into the Jetty ResourceServlet code, it looks like if the servlet response is no longer of type ServletApiResponse, the content gets wrapped as a UnknownLengthHttpContent. Thus, in ResourceService, ByteRange.parse cannot find the satisfiable ranges.

We're running into an issue where our servlet response is getting wrapped by our usage of Spring Security and the filter logic supplied there. However, it appears the logic in ResourceServlet is intentional in this, stating -

// Servlet Filters could be interacting with the Response already.
                if (useServletResponse)
                    content = new UnknownLengthHttpContent(content);

What is the intended way for this to work and what should we be doing to solve for this? Or is this behavior unintentional and therefore a bug? For now, we have built out our own Servlet which unwraps the response for those video requests but that doesn't seem the the appropriate long term solution.

@janbartel
Copy link
Contributor

@gregw looking at the code in ResourceServlet, I don't see why we are wrapping the HttpContent as an UnknownLengthHttpContent if a filter has wrapped the response? Maybe in the case where the wrapped response has already been written to it may make sense, but not otherwise.

@janbartel
Copy link
Contributor

@gregw nudge?

gregw added a commit that referenced this issue Feb 28, 2025
Fix #12792 by not hiding the content length unless the response has already been written.
@gregw gregw closed this as completed in f936e89 Mar 1, 2025
@joakime joakime changed the title Jetty 12 issue rendering imbedded videos Issue when scrolling around in embedded videos Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants