Fix sendForward() to define Content-Range header, as required by HTML5 audio and video tags.
This commit is contained in:
parent
a9e1cf3f51
commit
74b927244e
1 changed files with 4 additions and 0 deletions
|
@ -464,7 +464,11 @@ public abstract class AbstractServletClient extends HttpServlet {
|
|||
}
|
||||
int length = (int) file.length();
|
||||
res.setContentLength(length);
|
||||
// Erase charset so content-type is not messed with.
|
||||
hopres.setCharset(null);
|
||||
res.setContentType(hopres.getContentType());
|
||||
// Define full Content-Range, as required by HTML5 video and audio
|
||||
res.setHeader("Content-Range", "bytes 0-" + length + "/" + length);
|
||||
|
||||
InputStream in = cx.getResourceAsStream(forward);
|
||||
if (in == null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue