test_class.declarator: remote0000Address = InetSocketAddress.createUnresolved("0.0.0.0", 1234)
test_class.modifier: private final
test_class.original_string: private final InetSocketAddress remote0000Address = InetSocketAddress.createUnresolved("0.0.0.0", 1234);
test_class.type: InetSocketAddress
test_class.var_name: remote0000Address
test_class.declarator: trustOne = XForwardedRemoteAddressResolver.maxTrustedIndex(1)
test_class.modifier: private final
test_class.original_string: private final XForwardedRemoteAddressResolver trustOne = XForwardedRemoteAddressResolver.maxTrustedIndex(1);
test_class.type: XForwardedRemoteAddressResolver
test_class.var_name: trustOne
test_class.declarator: trustAll = XForwardedRemoteAddressResolver.trustAll()
test_class.modifier: private final
test_class.original_string: private final XForwardedRemoteAddressResolver trustAll = XForwardedRemoteAddressResolver.trustAll();
test_class.type: XForwardedRemoteAddressResolver
test_class.var_name: trustAll
test_class.file: spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/support/ipresolver/XForwardedRemoteAddressResolverTest.java
test_class.identifier: XForwardedRemoteAddressResolverTest
test_case.body: @Test
  	public void trustOneFallsBackOnMultipleHeaders() {
  		ServerWebExchange exchange = buildExchange(
  				remoteAddressOnlyBuilder().header("X-Forwarded-For", "0.0.0.1").header("X-Forwarded-For", "0.0.0.2"));
  
  		InetSocketAddress address = trustOne.resolve(exchange);
  
  		assertThat(address.getHostName()).isEqualTo("0.0.0.0");
  	}
test_case.class_method_signature: XForwardedRemoteAddressResolverTest.trustOneFallsBackOnMultipleHeaders()
test_case.full_signature: @Test public void trustOneFallsBackOnMultipleHeaders()
test_case.identifier: trustOneFallsBackOnMultipleHeaders
test_case.invocations: buildExchange header header remoteAddressOnlyBuilder resolve isEqualTo assertThat getHostName
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void trustOneFallsBackOnMultipleHeaders()
focal_class.declarator: X_FORWARDED_FOR = "X-Forwarded-For"
focal_class.modifier: public static final
focal_class.original_string: public static final String X_FORWARDED_FOR = "X-Forwarded-For";
focal_class.type: String
focal_class.var_name: X_FORWARDED_FOR
focal_class.declarator: log = LoggerFactory.getLogger(XForwardedRemoteAddressResolver.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(XForwardedRemoteAddressResolver.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: defaultRemoteIpResolver = new RemoteAddressResolver() {
  	}
focal_class.modifier: private final
focal_class.original_string: private final RemoteAddressResolver defaultRemoteIpResolver = new RemoteAddressResolver() {
  	};
focal_class.type: RemoteAddressResolver
focal_class.var_name: defaultRemoteIpResolver
focal_class.declarator: maxTrustedIndex
focal_class.modifier: private final
focal_class.original_string: private final int maxTrustedIndex;
focal_class.type: int
focal_class.var_name: maxTrustedIndex
focal_class.file: spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/support/ipresolver/XForwardedRemoteAddressResolver.java
focal_class.identifier: XForwardedRemoteAddressResolver
focal_class.interfaces: implements RemoteAddressResolver
focal_class.class_method_signature: XForwardedRemoteAddressResolver.XForwardedRemoteAddressResolver(int maxTrustedIndex)
focal_class.full_signature: private  XForwardedRemoteAddressResolver(int maxTrustedIndex)
focal_class.identifier: XForwardedRemoteAddressResolver
focal_class.modifiers: private
focal_class.parameters: (int maxTrustedIndex)
focal_class.signature:  XForwardedRemoteAddressResolver(int maxTrustedIndex)
focal_class.class_method_signature: XForwardedRemoteAddressResolver.trustAll()
focal_class.full_signature: public static XForwardedRemoteAddressResolver trustAll()
focal_class.identifier: trustAll
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: XForwardedRemoteAddressResolver
focal_class.signature: XForwardedRemoteAddressResolver trustAll()
focal_class.class_method_signature: XForwardedRemoteAddressResolver.maxTrustedIndex(int maxTrustedIndex)
focal_class.full_signature: public static XForwardedRemoteAddressResolver maxTrustedIndex(int maxTrustedIndex)
focal_class.identifier: maxTrustedIndex
focal_class.modifiers: public static
focal_class.parameters: (int maxTrustedIndex)
focal_class.return: XForwardedRemoteAddressResolver
focal_class.signature: XForwardedRemoteAddressResolver maxTrustedIndex(int maxTrustedIndex)
focal_class.class_method_signature: XForwardedRemoteAddressResolver.resolve(ServerWebExchange exchange)
focal_class.full_signature: @Override public InetSocketAddress resolve(ServerWebExchange exchange)
focal_class.identifier: resolve
focal_class.modifiers: @Override public
focal_class.parameters: (ServerWebExchange exchange)
focal_class.return: InetSocketAddress
focal_class.signature: InetSocketAddress resolve(ServerWebExchange exchange)
focal_class.class_method_signature: XForwardedRemoteAddressResolver.extractXForwardedValues(ServerWebExchange exchange)
focal_class.full_signature: private List<String> extractXForwardedValues(ServerWebExchange exchange)
focal_class.identifier: extractXForwardedValues
focal_class.modifiers: private
focal_class.parameters: (ServerWebExchange exchange)
focal_class.return: List<String>
focal_class.signature: List<String> extractXForwardedValues(ServerWebExchange exchange)
focal_method.body: @Override
  	public InetSocketAddress resolve(ServerWebExchange exchange) {
  		List<String> xForwardedValues = extractXForwardedValues(exchange);
  		Collections.reverse(xForwardedValues);
  		if (!xForwardedValues.isEmpty()) {
  			int index = Math.min(xForwardedValues.size(), maxTrustedIndex) - 1;
  			return new InetSocketAddress(xForwardedValues.get(index), 0);
  		}
  		return defaultRemoteIpResolver.resolve(exchange);
  	}
focal_method.class_method_signature: XForwardedRemoteAddressResolver.resolve(ServerWebExchange exchange)
focal_method.full_signature: @Override public InetSocketAddress resolve(ServerWebExchange exchange)
focal_method.identifier: resolve
focal_method.invocations: extractXForwardedValues reverse isEmpty min size get resolve
focal_method.modifiers: @Override public
focal_method.parameters: (ServerWebExchange exchange)
focal_method.return: InetSocketAddress
focal_method.signature: InetSocketAddress resolve(ServerWebExchange exchange)