Reintroduce basic DoS filter in web app

This commit is contained in:
Sean Owen 2015-05-13 12:14:01 +01:00
parent 7774683247
commit fa1c1ededf

View file

@ -84,7 +84,7 @@ import javax.servlet.http.Part;
maxRequestSize = 10_000_000, maxRequestSize = 10_000_000,
fileSizeThreshold = 1_000_000, fileSizeThreshold = 1_000_000,
location = "/tmp") location = "/tmp")
@WebServlet("/w/decode") @WebServlet(value = "/w/decode", loadOnStartup = 1)
public final class DecodeServlet extends HttpServlet { public final class DecodeServlet extends HttpServlet {
private static final Logger log = Logger.getLogger(DecodeServlet.class.getName()); private static final Logger log = Logger.getLogger(DecodeServlet.class.getName());
@ -204,13 +204,13 @@ public final class DecodeServlet extends HttpServlet {
try { try {
connection.connect(); connection.connect();
} catch (IOException ioe) { } catch (IOException | IllegalArgumentException e) {
// Encompasses lots of stuff, including // Encompasses lots of stuff, including
// java.net.SocketException, java.net.UnknownHostException, // java.net.SocketException, java.net.UnknownHostException,
// javax.net.ssl.SSLPeerUnverifiedException, // javax.net.ssl.SSLPeerUnverifiedException,
// org.apache.http.NoHttpResponseException, // org.apache.http.NoHttpResponseException,
// org.apache.http.client.ClientProtocolException, // org.apache.http.client.ClientProtocolException,
log.info(ioe.toString()); log.info(e.toString());
errorResponse(request, response, "badurl"); errorResponse(request, response, "badurl");
return; return;
} }