Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Routing when a configuration exists with query param wildcard #2132

Open
garv-daga opened this issue Aug 1, 2024 · 8 comments · May be fixed by #2225
Open

Incorrect Routing when a configuration exists with query param wildcard #2132

garv-daga opened this issue Aug 1, 2024 · 8 comments · May be fixed by #2225
Labels
bug Identified as a potential bug Dec'24 December 2024 release high High priority Routing Ocelot feature: Routing
Milestone

Comments

@garv-daga
Copy link

garv-daga commented Aug 1, 2024

Ocelot now matches routes incorrectly.
This started breaking between versions 22.0.1 and 23.0.0.

If I have two configurations -

{
  "Routes": [
    {
      "DownstreamHostAndPorts": [
        {
          "Host": "{Endpoint1}"
        }
      ],
      "DownstreamPathTemplate": "/api/v1/abc?{everything}",
      "DownstreamScheme": "https",
      "UpstreamPathTemplate": "/api/v1/abc?{everything}"
    },
    {
      "DownstreamHostAndPorts": [
        {
          "Host": "{Endpoint2}"
        }
      ],
      "DownstreamPathTemplate": "/api/v1/{everything}",
      "DownstreamScheme": "https",
      "UpstreamPathTemplate": "/api/v1/abc2/{everything}"
    }
  ]
}

Now if I initiate a call with /api/v1/abc2/apple?isRequired=1

Expected Route: {Endpoint2}/api/v1/apple?isRequired=1

Actually Routes to: {Endpoint1}/api/v1/abc?isRequired=1"

Similar issue reported in: Originally posted by @Burgyn in #2065

@raman-m raman-m added bug Identified as a potential bug Routing Ocelot feature: Routing labels Aug 1, 2024
@raman-m
Copy link
Member

raman-m commented Aug 1, 2024

Duplicate of #2064 #2065

@raman-m raman-m marked this as a duplicate of #2064 Aug 1, 2024
@raman-m
Copy link
Member

raman-m commented Aug 1, 2024

Thanks for reporting this! Are you C# developer?

@garv-daga
Copy link
Author

Thanks for reporting this! Are you C# developer?

Thanks, Yes C# developer.

@raman-m
Copy link
Member

raman-m commented Aug 1, 2024

Could you look into the issue by debugging the solution and examining Ocelot's code when you have some spare time, please?
I am currently swamped with tasks for the v23.3 Hotfixes. I anticipate an open PR that will shed light on the issue, which I suspect might be related to a Regex problem.

@raman-m
Copy link
Member

raman-m commented Sep 21, 2024 via email

@pwshfan
Copy link

pwshfan commented Sep 21, 2024

@lelloz0 Hello Raffaele, Why did you delete your comment from issue #2132? Please be aware that using wildcards is not supported in Ocelot templates or placeholders. If you encounter any unusual behavior with special characters, please let us know.

I realized the issue is indeed somewhere else and not related to the wildcards. Thanks for the follow up!

@raman-m
Copy link
Member

raman-m commented Sep 21, 2024

@pwshfan, okay, we will concentrate on the originally reported bug. Feel free to report any issues, but please create new ones.

@raman-m raman-m added Dec'24 December 2024 release and removed Oct'24 October 2024 release labels Oct 26, 2024
@raman-m raman-m modified the milestones: October'24, Autumn'24 Oct 26, 2024
@raman-m
Copy link
Member

raman-m commented Nov 8, 2024

@int0x81, welcome to your assignment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identified as a potential bug Dec'24 December 2024 release high High priority Routing Ocelot feature: Routing
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants