From 2f59a4b3e646aaaa0210d2353dba55507649477a Mon Sep 17 00:00:00 2001 From: str4d <str4d@mail.i2p> Date: Tue, 21 Jul 2015 00:40:35 +0000 Subject: [PATCH] Fix test --- .../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java | 2 +- .../junit/net/i2p/i2ptunnel/I2PTunnelHTTPServerTest.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java index 4b06ae0789..6b3b417201 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java @@ -817,7 +817,7 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer { * @throws BadRequestException on bad headers * @throws IOException on other errors in the underlying stream */ - private static Map<String, List<String>> readHeaders(I2PSocket socket, InputStream in, StringBuilder command, + static Map<String, List<String>> readHeaders(I2PSocket socket, InputStream in, StringBuilder command, String[] skipHeaders, I2PAppContext ctx) throws IOException { HashMap<String, List<String>> headers = new HashMap<String, List<String>>(); StringBuilder buf = new StringBuilder(128); diff --git a/apps/i2ptunnel/java/test/junit/net/i2p/i2ptunnel/I2PTunnelHTTPServerTest.java b/apps/i2ptunnel/java/test/junit/net/i2p/i2ptunnel/I2PTunnelHTTPServerTest.java index 19302a6248..7132a7da2f 100644 --- a/apps/i2ptunnel/java/test/junit/net/i2p/i2ptunnel/I2PTunnelHTTPServerTest.java +++ b/apps/i2ptunnel/java/test/junit/net/i2p/i2ptunnel/I2PTunnelHTTPServerTest.java @@ -28,7 +28,7 @@ public class I2PTunnelHTTPServerTest extends TestCase { headerString += "BLAH: something\r\n"; headerString += "\r\n"; InputStream in = fillInputStream(headerString); - Map<String, List<String>> headers = I2PTunnelHTTPServer.readHeaders(in, new StringBuilder(128), new String[0], I2PAppContext.getGlobalContext()); + Map<String, List<String>> headers = I2PTunnelHTTPServer.readHeaders(null, in, new StringBuilder(128), new String[0], I2PAppContext.getGlobalContext()); assertEquals(headers.size(), 1); //One header } @@ -38,7 +38,7 @@ public class I2PTunnelHTTPServerTest extends TestCase { headerString += "someHeader: oh my, duplication!\r\n"; headerString += "\r\n"; InputStream in = fillInputStream(headerString); - Map<String, List<String>> headers = I2PTunnelHTTPServer.readHeaders(in, new StringBuilder(128), new String[0], I2PAppContext.getGlobalContext()); + Map<String, List<String>> headers = I2PTunnelHTTPServer.readHeaders(null, in, new StringBuilder(128), new String[0], I2PAppContext.getGlobalContext()); assertEquals(headers.size(), 1); assertEquals(headers.get("someHeader").size(), 2); } @@ -51,7 +51,7 @@ public class I2PTunnelHTTPServerTest extends TestCase { headerString += "\r\n"; InputStream in = fillInputStream(headerString); StringBuilder builder = new StringBuilder(128); - Map<String, List<String>> headers = I2PTunnelHTTPServer.readHeaders(in, builder, new String[0], I2PAppContext.getGlobalContext()); + Map<String, List<String>> headers = I2PTunnelHTTPServer.readHeaders(null, in, builder, new String[0], I2PAppContext.getGlobalContext()); String result = I2PTunnelHTTPServer.formatHeaders(headers, builder); int first = result.indexOf("abc"); assertTrue(first >= 0); -- GitLab