HTTP header snafu

This commit is contained in:
Knut Forkalsrud 2009-01-24 11:23:33 -08:00
parent b3f35ba64c
commit d6a4b0eb45

View file

@ -92,10 +92,8 @@ public class AlbumServlet
if (size != null) { if (size != null) {
try { try {
res.setContentType("image/jpeg");
FileEntry e = (FileEntry)DirectoryEntry.getEntry(file); FileEntry e = (FileEntry)DirectoryEntry.getEntry(file);
scaleImage(req, res, file, e.getThumbnail(), size); scaleImage(req, res, file, e.getThumbnail(), size);
res.setStatus(HttpServletResponse.SC_OK);
return; return;
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("sadness", e); throw new RuntimeException("sadness", e);
@ -267,7 +265,8 @@ public class AlbumServlet
System.out.println(" " + key + " added to the cache with size " + cimg.bits.length + " -- now " + imageCache.getSize() + " entries"); System.out.println(" " + key + " added to the cache with size " + cimg.bits.length + " -- now " + imageCache.getSize() + " entries");
//res.setContentType(cimg.mimeType); res.setStatus(HttpServletResponse.SC_OK);
res.setContentType(cimg.mimeType);
res.setContentLength(cimg.bits.length); res.setContentLength(cimg.bits.length);
res.getOutputStream().write(cimg.bits); res.getOutputStream().write(cimg.bits);
} }