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) {
169
169
for (Map .Entry <String , String > header : headers ) {
170
170
String name = header .getKey ();
171
171
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" )) {
173
173
request .headers ().add (name , value );
174
174
}
175
175
}
Original file line number Diff line number Diff line change @@ -448,6 +448,7 @@ public Future<Void> handleProxyResponse(ProxyContext context) {
448
448
@ Test
449
449
public void testUpdateRequestHeaders (TestContext ctx ) throws Exception {
450
450
SocketAddress backend = startHttpBackend (ctx , 8081 , req -> {
451
+ ctx .assertNotEquals ("example.org" , req .getHeader ("Host" ));
451
452
ctx .assertNull (req .getHeader ("header" ));
452
453
ctx .assertEquals ("proxy_header_value" , req .getHeader ("proxy_header" ));
453
454
req .response ().putHeader ("header" , "header_value" ).end ();
@@ -456,6 +457,7 @@ public void testUpdateRequestHeaders(TestContext ctx) throws Exception {
456
457
startHttpServer (ctx , serverOptions , req -> {
457
458
ProxyRequest proxyReq = ProxyRequest .reverseProxy (req );
458
459
MultiMap clientHeaders = proxyReq .headers ();
460
+ clientHeaders .add ("Host" , "example.org" );
459
461
clientHeaders .add ("proxy_header" , "proxy_header_value" );
460
462
ctx .assertEquals ("header_value" , clientHeaders .get ("header" ));
461
463
clientHeaders .remove ("header" );
You can’t perform that action at this time.
0 commit comments