From 593cb390591a937af401af379ccd9424ecaa6591 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 14 Nov 2014 10:28:04 +1100 Subject: [PATCH] Implemented the PROXY protocol Removed old HttpParser PROXY tests --- .../eclipse/jetty/http/HttpParserTest.java | 57 ------------------- 1 file changed, 57 deletions(-) diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java index 342cec10f40..d159883cf93 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java @@ -1496,63 +1496,6 @@ public class HttpParserTest } - @Test - public void testProxyProtocol() throws Exception - { - ByteBuffer buffer=BufferUtil - .toBuffer("PROXY TCP4 107.47.45.254 10.0.1.116 27689 80\015\012" - +"GET / HTTP/1.1\015\012" - +"Host: localhost \015\012" - +"Connection: close\015\012"+"\015\012"+"\015\012"); - - Handler handler=new Handler(); - HttpParser parser=new HttpParser((HttpParser.RequestHandler)handler); - parseAll(parser, buffer); - - assertTrue(_headerCompleted); - assertTrue(_messageCompleted); - assertEquals("GET", _methodOrVersion); - assertEquals("/", _uriOrStatus); - assertEquals("HTTP/1.1", _versionOrReason); - assertEquals("PROXY TCP4 107.47.45.254 10.0.1.116 27689 80", handler._proxy); - assertEquals("Host", _hdr[0]); - assertEquals("localhost", _val[0]); - assertEquals("Connection", _hdr[1]); - assertEquals("close", _val[1]); - assertEquals(1, _headers); - } - - @Test - public void testSplitProxyHeaderParseTest() throws Exception - { - Handler handler=new Handler(); - HttpParser parser=new HttpParser((HttpParser.RequestHandler)handler); - - ByteBuffer buffer=BufferUtil.toBuffer("PROXY TCP4 207.47.45.254 10.0.1.116 27689 80\015\012"); - parser.parseNext(buffer); - - buffer=BufferUtil.toBuffer( - "GET / HTTP/1.1\015\012" - +"Host: localhost \015\012" - +"Connection: close\015\012" - +"\015\012" - +"\015\012"); - - parser.parseNext(buffer); - assertTrue(_headerCompleted); - assertTrue(_messageCompleted); - assertEquals("GET", _methodOrVersion); - assertEquals("/", _uriOrStatus); - assertEquals("HTTP/1.1", _versionOrReason); - assertEquals("PROXY TCP4 207.47.45.254 10.0.1.116 27689 80", handler._proxy); - assertEquals("Host", _hdr[0]); - assertEquals("localhost", _val[0]); - assertEquals("Connection", _hdr[1]); - assertEquals("close", _val[1]); - assertEquals(1, _headers); - } - - @Test public void testFolded() throws Exception {