String range = request.getHeader("Range");
MediaLoader.ByteRange rangeSpec = null;
if ((range != null) && (range.startsWith("bytes=")))
{
range = range.substring(6);
int inx = range.indexOf("-");
if (inx > 0)
{
int start = Integer.parseInt(range.substring(0, inx).trim());
int end = Integer.parseInt(range.substring(inx + 1).trim());
rangeSpec = new MediaLoader.ByteRange(start, end);
}
}
First it extracts "Range" from header and expect to be in format "bytes=-" So valid value could be "bytes=0-100" or bytes=0-200 for example But in our case "Range" has value "bytes=0-" so it fails on parsing on:
int end = Integer.parseInt(range.substring(inx + 1).trim());
Inside catch section during error handling at the end it returns 404:
response.sendError(404, "404 (NOT FOUND): " + path);
which is false information.
SAP is handling error on header attribute parsing in a very problematic way - it says that such resource not exists!