This commit is contained in:
str4d
2015-07-21 00:40:35 +00:00
parent 63e934f8f2
commit 2f59a4b3e6
2 changed files with 4 additions and 4 deletions

View File

@@ -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);

View File

@@ -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);