From 31aea7e2bcabb461a324341186a09a99e3139758 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johannes=20Dahlstr=C3=B6m?= Date: Wed, 13 May 2015 11:03:58 +0300 Subject: [PATCH] Catch even more exceptions when trying to open a gzipped resource (#13653) URL.openConnection may also throw if the file does not exist. Change-Id: I254a5b6591f34b0f11b20c6c9ab81c0cb51af672 --- server/src/com/vaadin/server/VaadinServlet.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java index b30f6acf16..7aada2402d 100644 --- a/server/src/com/vaadin/server/VaadinServlet.java +++ b/server/src/com/vaadin/server/VaadinServlet.java @@ -871,9 +871,8 @@ public class VaadinServlet extends HttpServlet implements Constants { if (allowServePrecompressedResource(request, urlStr)) { // try to serve a precompressed version if available - URL url = new URL(urlStr + ".gz"); - connection = url.openConnection(); try { + connection = new URL(urlStr + ".gz").openConnection(); is = connection.getInputStream(); // set gzip headers response.setHeader("Content-Encoding", "gzip"); -- 2.39.5