File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
main/java/io/vertx/httpproxy/impl
test/java/io/vertx/httpproxy Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ void sendRequest(Handler<AsyncResult<ProxyResponse>> responseHandler) {
169169 for (Map .Entry <String , String > header : headers ) {
170170 String name = header .getKey ();
171171 String value = header .getValue ();
172- if (!HOP_BY_HOP_HEADERS .contains (name ) && !name .equals ("host" )) {
172+ if (!HOP_BY_HOP_HEADERS .contains (name ) && !name .equalsIgnoreCase ("host" )) {
173173 request .headers ().add (name , value );
174174 }
175175 }
Original file line number Diff line number Diff line change @@ -448,6 +448,7 @@ public Future<Void> handleProxyResponse(ProxyContext context) {
448448 @ Test
449449 public void testUpdateRequestHeaders (TestContext ctx ) throws Exception {
450450 SocketAddress backend = startHttpBackend (ctx , 8081 , req -> {
451+ ctx .assertNotEquals ("example.org" , req .getHeader ("Host" ));
451452 ctx .assertNull (req .getHeader ("header" ));
452453 ctx .assertEquals ("proxy_header_value" , req .getHeader ("proxy_header" ));
453454 req .response ().putHeader ("header" , "header_value" ).end ();
@@ -456,6 +457,7 @@ public void testUpdateRequestHeaders(TestContext ctx) throws Exception {
456457 startHttpServer (ctx , serverOptions , req -> {
457458 ProxyRequest proxyReq = ProxyRequest .reverseProxy (req );
458459 MultiMap clientHeaders = proxyReq .headers ();
460+ clientHeaders .add ("Host" , "example.org" );
459461 clientHeaders .add ("proxy_header" , "proxy_header_value" );
460462 ctx .assertEquals ("header_value" , clientHeaders .get ("header" ));
461463 clientHeaders .remove ("header" );
You can’t perform that action at this time.
0 commit comments