mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Reintroduce basic DoS filter in web app
This commit is contained in:
parent
7774683247
commit
fa1c1ededf
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue