Issue #2706 - Resource Service Incorrectly Returning 404
changes from review Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
0f3f77761f
commit
8444681880
|
@ -535,6 +535,7 @@ public class ResourceService
|
|||
if (!match)
|
||||
{
|
||||
response.setStatus(HttpServletResponse.SC_PRECONDITION_FAILED);
|
||||
response.flushBuffer();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -546,6 +547,7 @@ public class ResourceService
|
|||
{
|
||||
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
|
||||
response.setHeader(HttpHeader.ETAG.asString(),ifnm);
|
||||
response.flushBuffer();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -557,6 +559,7 @@ public class ResourceService
|
|||
{
|
||||
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
|
||||
response.setHeader(HttpHeader.ETAG.asString(),tag);
|
||||
response.flushBuffer();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -738,6 +741,7 @@ public class ResourceService
|
|||
List<InclusiveByteRange> ranges =InclusiveByteRange.satisfiableRanges( reqRanges, content_length);
|
||||
|
||||
// if there are no satisfiable ranges, send 416 response
|
||||
// TODO should we be doing a 416 with a body
|
||||
if (ranges==null || ranges.size()==0)
|
||||
{
|
||||
putHeaders(response,content,0);
|
||||
|
|
|
@ -455,7 +455,8 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory, Welc
|
|||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException
|
||||
{
|
||||
_resourceService.doGet(request,response);
|
||||
if(!_resourceService.doGet(request,response))
|
||||
response.sendError(404);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
|
|
Loading…
Reference in New Issue