-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Add support for http byte-range requests [SPR-10805] #15431
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
Comments
Thomas Meyer commented This post seems related, I haven't tried it though: http://datum-bits.blogspot.fr/2013/01/implementing-http-byte-range-requests_30.html |
Rossen Stoyanchev commented Are you running on Tomcat? It looks like the DefaultServlet there supports byte-range requests. In which case it might be simply be a matter of enabling default service handling in your Spring MVC config. When the ResourceHttpRequestHandler can't find a resource it forwarded to the container's "default" servlet. More generally speaking the ResourceHttpRequestHandler was designed for serving application resources (css, js, images, etc) and is not optimized for serving large files (like videos) which is what byte-ranges would be most attractive. So if we added such support it would almost have to along with more optimal IO (e.g. file mapped byte buffer) to support the use case fully. |
Arjen Poutsma commented PR at #754 |
Rossen Stoyanchev commented This is now available in the master branch (4.2.0.BUILD-SNAPSHOT). Nicolas Pottrain it would be very good if you could verify it works for you. Thanks! |
Andrei Holub commented I have some issues in Chrome after this feature was added. Is it any way to manually disable it? |
Kevin McLaughlin commented We ended up adding a servlet filter that drops attempts to set ACCEPT_RANGE header. Sample bootapp showing this issue is at https://github.com/krm1312/springrangeissues. Take that project and:
and then try a range request with curl:
It effectively hangs. |
Kevin McLaughlin commented If anybody else runs into this issue... Just removing Accept-Range didn't work. RFC says browsers may send a range request anyway. Now we're setting Accept-Range: none in the filter and hiding any incoming Range header (by wrapping the request and overriding getHeader). Basically, try to tell the browser we don't support range requests and even if the browser sends a range request, ignore it and serve up a 200 with full content. |
Rossen Stoyanchev commented Andrei Holub, would you mind creating a new ticket to describe the issue with Chrome you're running into? We can add a way to disable it but would like to get some more details. Kevin McLaughlin, it sounds like your issue is with actually trying to use byte ranges without success? Would you mind also creating a new ticket? We'll take a look. This ticket is for the original request and is already closed and will not be re-opened. Thanks! |
Kevin McLaughlin commented Andrei and I are colleagues, so, describing the same incident/app. Will open two new tickets though - one to allow disabling and one to investigate/fix the issue when enabled. |
Kevin McLaughlin commented |
Nicolas Pottrain opened SPR-10805 and commented
Is it possible to add support for byte-range requests in the mvc:resources ResourceHttpRequestHandler.
This will enable the serving of video files to iOS devices and for Safari on Mac.
Affects: 3.2.3
Reference URL: http://forum.springsource.org/showthread.php?114763-HTTP-byte-range-requests-for-resources-in-Spring-MVC
Issue Links:
3 votes, 12 watchers
The text was updated successfully, but these errors were encountered: