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

Use replacePath in ProxyExchangeHandlerFunction

Open LFM opened this issue 2 years ago • 5 comments

LFM avatar Dec 05 '23 06:12 LFM

@LFM Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

pivotal-cla avatar Dec 05 '23 06:12 pivotal-cla

@LFM Thank you for signing the Contributor License Agreement!

pivotal-cla avatar Dec 05 '23 07:12 pivotal-cla

Can you explain what this is trying to do?

spencergibb avatar Dec 05 '23 08:12 spencergibb

Can you explain what this is trying to do?

Config example:

spring:
  cloud:
    gateway:
      mvc:
        routes:
          - id: route1
            uri:
              http://localhost:1213
            predicates:
              - Path=/route1/**
          - id: route2
            uri:
              http://localhost:1214/service
            predicates:
              - Path=/route2/**
          - id: default
            uri:
              http://localhost:1214/service
            predicates:
              - Path=/**

My gateway port is 1212.

It was normal when I access 'http://localhost:1212/route1/xxx'. But when I access 'http://localhost:1212/default/xxx', the '/service' in the route's path is lost.

LFM avatar Dec 05 '23 09:12 LFM

oh no I fixed the same issue in https://github.com/spring-cloud/spring-cloud-gateway/pull/3260 - there I did provide a small reproducer project and a differently worded explanation which illustrates the issue (hopefully) clearly

Interessierter avatar Feb 09 '24 09:02 Interessierter

Closing in favor of #3293

spencergibb avatar Mar 11 '24 15:03 spencergibb