Patch for Bug # 2414062 Auth request delayed using RetrieveServlet

git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@3328 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Andrea Bollini
2008-12-11 16:22:33 +00:00
parent 5b12e2f551
commit b7c09dab17

View File

@@ -113,6 +113,9 @@ public class RetrieveServlet extends DSpaceServlet
log.info(LogManager.getHeader(context, "view_bitstream",
"bitstream_id=" + bitstream.getID()));
// Pipe the bits
InputStream is = bitstream.retrieve();
// Set the response MIME type
response.setContentType(bitstream.getFormat().getMIMEType());
@@ -120,9 +123,6 @@ public class RetrieveServlet extends DSpaceServlet
response.setHeader("Content-Length", String.valueOf(bitstream
.getSize()));
// Pipe the bits
InputStream is = bitstream.retrieve();
Utils.bufferedCopy(is, response.getOutputStream());
is.close();
response.getOutputStream().flush();