From f1d8a30ecac3f5fe78a4a158a3d4c928213645ba Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Wed, 24 Oct 2012 13:29:58 +0300 Subject: Return 404 if a resource cannot be found (#10053) Change-Id: Iaf87eb7af6f89decb61b7fd2ac953ca6a6dac15a --- server/src/com/vaadin/server/DownloadStream.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'server') diff --git a/server/src/com/vaadin/server/DownloadStream.java b/server/src/com/vaadin/server/DownloadStream.java index 3ba8b3d39a..5757f7ca93 100644 --- a/server/src/com/vaadin/server/DownloadStream.java +++ b/server/src/com/vaadin/server/DownloadStream.java @@ -250,6 +250,11 @@ public class DownloadStream implements Serializable { // Download from given stream final InputStream data = getStream(); + if (data == null) { + response.setStatus(HttpServletResponse.SC_NOT_FOUND); + return; + } + if (data != null) { OutputStream out = null; -- cgit v1.2.3