spring-cloud-gateway
spring-cloud-gateway copied to clipboard
Routes metadata keys are treated as case-insensitive when retrieved
Describe the bug cloudgatewayVersion = '4.3.0' When retrieving route metadata in Spring Cloud Gateway, the keys appear to be matched in a case-insensitive manner. This causes unexpected results.
Sample sample config:-
spring:
application:
name: gw
cloud:
gateway:
default-filters:
routes:
- id: route1
order: 1
uri: http://127.0.0.1:1010/
metadata:
customMetaData: abc
sample code:-
Route route = exchange.getAttribute(ServerWebExchangeUtils.GATEWAY_ROUTE_ATTR); Map<String, Object> metaData = route.getMetadata(); metaData.get("customMetaData"). // returns null
The issue appears to be with GatewayServerWebfluxPropertiesMigrationListener. When using the new prefix, it works as expected : spring.cloud.gateway.server.webflux