diff --git a/apps/addressbook/web.xml b/apps/addressbook/web.xml
index 1aebb0d096..d86d32289b 100644
--- a/apps/addressbook/web.xml
+++ b/apps/addressbook/web.xml
@@ -28,4 +28,11 @@
/*
+
+
+ 30
+
+ true
+
+
diff --git a/apps/i2psnark/web.xml b/apps/i2psnark/web.xml
index 68e6abd641..d98f637338 100644
--- a/apps/i2psnark/web.xml
+++ b/apps/i2psnark/web.xml
@@ -26,73 +26,14 @@
/
+
30
+
+ true
+
-
-
-
-
- mkv
- video/x-matroska
-
-
-
- wmv
- video/x-ms-wmv
-
-
-
- flv
- video/x-flv
-
-
-
- mp4
- video/mp4
-
-
-
- rar
- application/rar
-
-
-
- 7z
- application/x-7z-compressed
-
-
-
- iso
- application/x-iso9660-image
-
-
-
- ico
- image/x-icon
-
-
-
- exe
- application/x-msdos-program
-
-
-
- flac
- audio/flac
-
-
-
- m4a
- audio/mpeg
-
-
-
- wma
- audio/x-ms-wma
-
-
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java
index 8f963e6492..4b06ae0789 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java
@@ -71,11 +71,16 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
private static final long TOTAL_HEADER_TIMEOUT = 2 * HEADER_TIMEOUT;
private static final long START_INTERVAL = (60 * 1000) * 3;
private static final int MAX_LINE_LENGTH = 8*1024;
+ /** ridiculously long, just to prevent OOM DOS @since 0.7.13 */
+ private static final int MAX_HEADERS = 60;
+ /** Includes request, just to prevent OOM DOS @since 0.9.20 */
+ private static final int MAX_TOTAL_HEADER_SIZE = 32*1024;
+
private long _startedOn = 0L;
private ConnThrottler _postThrottler;
- private final static byte[] ERR_UNAVAILABLE =
- ("HTTP/1.1 503 Service Unavailable\r\n"+
+ private final static String ERR_UNAVAILABLE =
+ "HTTP/1.1 503 Service Unavailable\r\n"+
"Content-Type: text/html; charset=iso-8859-1\r\n"+
"Cache-control: no-cache\r\n"+
"Connection: close\r\n"+
@@ -84,11 +89,10 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
"
503 Service Unavailable\n"+
"503 Service Unavailable
\n" +
"This I2P website is unavailable. It may be down or undergoing maintenance.
\n" +
- "")
- .getBytes();
+ "