spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Routes metadata keys are treated as case-insensitive when retrieved

Open sukawanth opened this issue 5 months ago • 0 comments

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

sukawanth avatar Aug 08 '25 08:08 sukawanth