diff --git a/dev/com.ibm.ws.http2.client/src/com/ibm/ws/http2/test/frames/FrameSettingsClient.java b/dev/com.ibm.ws.http2.client/src/com/ibm/ws/http2/test/frames/FrameSettingsClient.java index 5a25ad5b7b7..dbd12b539b9 100644 --- a/dev/com.ibm.ws.http2.client/src/com/ibm/ws/http2/test/frames/FrameSettingsClient.java +++ b/dev/com.ibm.ws.http2.client/src/com/ibm/ws/http2/test/frames/FrameSettingsClient.java @@ -30,25 +30,6 @@ public class FrameSettingsClient extends com.ibm.ws.http.channel.h2internal.fram private final ByteBuf frame; - static { - // We discovered an issue with the adaptive allocator using Unsafe being unavailable - // and throwing exceptions which do not allow the tests to proceed due to Java 2 Security. - // Because of this, while this is fixed we will use the pooled allocator as before to - // ensure proper testing - if (System.getSecurityManager() == null) { - System.setProperty("io.netty.allocator.type", "pooled"); - } - else { - AccessController.doPrivileged(new PrivilegedAction() { - @Override - public Void run() { - System.setProperty("io.netty.allocator.type", "pooled"); - return null; - } - }); - } - } - /** * * @param streamId diff --git a/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundServiceContextImpl.java b/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundServiceContextImpl.java index c7417db132e..83c4b7bb65e 100644 --- a/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundServiceContextImpl.java +++ b/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundServiceContextImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2025 IBM Corporation and others. + * Copyright (c) 2004, 2026 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -2285,7 +2285,20 @@ private void nettyInitForwardedValues() { Matcher matcher = null; String remoteIp = nettyContext.channel().remoteAddress().toString(); - remoteIp = remoteIp.substring(1, remoteIp.indexOf(':')); + // Note: Format changed in Netty 4.2 + // Handing updated to work with both formats: "/127.0.0.1:port" and "hostname/127.0.0.1:port" + + // If there's a hostname prefix (e.g., "localhost/127.0.0.1:port") or it starts with a forward slash, + // Extract just the IP:Port part + int slashIndex = remoteIp.indexOf('/'); + if (slashIndex > 0) { + remoteIp = remoteIp.substring(slashIndex + 1); + } + // Extract IP address before the port + int colonIndex = remoteIp.indexOf(':'); + if (colonIndex > 0) { + remoteIp = remoteIp.substring(0, colonIndex); + } String attribute; diff --git a/dev/io.openliberty.netty.internal.impl/src/io/openliberty/netty/internal/impl/NettyFrameworkImpl.java b/dev/io.openliberty.netty.internal.impl/src/io/openliberty/netty/internal/impl/NettyFrameworkImpl.java index a1313e7691e..ddc8ed78dfc 100644 --- a/dev/io.openliberty.netty.internal.impl/src/io/openliberty/netty/internal/impl/NettyFrameworkImpl.java +++ b/dev/io.openliberty.netty.internal.impl/src/io/openliberty/netty/internal/impl/NettyFrameworkImpl.java @@ -226,13 +226,13 @@ private void setNettySystemProperties() { // issues are found and leak detection is needed to debug them. System.setProperty("io.netty.leakDetection.level", "DISABLED"); } - if (System.getProperty("io.netty.allocator.type") == null) { - // On Netty version 4.2, the default allocator changed from pooled to adaptive and so - // as of that moment, the adaptive allocator showed a regression from the pooled allocator - // used in Netty 4.1. We switch to the pooled allocator for the moment until these issues - // are addressed - System.setProperty("io.netty.allocator.type", "pooled"); - } + // if (System.getProperty("io.netty.allocator.type") == null) { + // // On Netty version 4.2, the default allocator changed from pooled to adaptive and so + // // as of that moment, the adaptive allocator showed a regression from the pooled allocator + // // used in Netty 4.1. We switch to the pooled allocator for the moment until these issues + // // are addressed + // System.setProperty("io.netty.allocator.type", "pooled"); + // } } /*