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 @@ -451,6 +451,7 @@ public Future<Void> handleProxyResponse(ProxyContext context) {
451451 @ Test
452452 public void testUpdateRequestHeaders (TestContext ctx ) throws Exception {
453453 SocketAddress backend = startHttpBackend (ctx , 8081 , req -> {
454+ ctx .assertNotEquals ("example.org" , req .getHeader ("Host" ));
454455 ctx .assertNull (req .getHeader ("header" ));
455456 ctx .assertEquals ("proxy_header_value" , req .getHeader ("proxy_header" ));
456457 req .response ().putHeader ("header" , "header_value" ).end ();
@@ -459,6 +460,7 @@ public void testUpdateRequestHeaders(TestContext ctx) throws Exception {
459460 startHttpServer (ctx , serverOptions , req -> {
460461 ProxyRequest proxyReq = ProxyRequest .reverseProxy (req );
461462 MultiMap clientHeaders = proxyReq .headers ();
463+ clientHeaders .add ("Host" , "example.org" );
462464 clientHeaders .add ("proxy_header" , "proxy_header_value" );
463465 ctx .assertEquals ("header_value" , clientHeaders .get ("header" ));
464466 clientHeaders .remove ("header" );
You can’t perform that action at this time.
0 commit comments