Skip to content

Allow QUERY in route Match.Methods - #3079

Merged
MihaZupan merged 1 commit into
dotnet:mainfrom
jonorogers:query-route-method
Nov 23, 2026
Merged

MihaZupan merged 1 commit into
dotnet:mainfrom
jonorogers:query-route-method

Conversation

@jonorogers

Copy link
Copy Markdown

Fixes #3078

Since #3070 YARP recognises and forwards QUERY, but MethodsValidator still rejected it in Match.Methods with "Unsupported HTTP method", so a route could only accept QUERY by dropping Methods altogether.

Changes:

  • Add QUERY to the allowed set in MethodsValidator.
  • ConfigValidatorTests.Accepts_ValidRules: QUERY and mixed-case gEt,quERy cases.
  • RoutingTests.MethodRouting_Query_Works: a QUERY-only route matches a QUERY request, and a POST to the same path gets 405. Covers QUERY and query in config.

build.cmd -test passes locally on net10.0, net11.0 and net12.0.

@MihaZupan MihaZupan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@MihaZupan MihaZupan added this to the YARP 3.0 milestone Nov 23, 2026
@MihaZupan
MihaZupan merged commit 6ec4b30 into dotnet:main Nov 23, 2026
7 checks passed
@jonorogers

Copy link
Copy Markdown
Author

No worries, glad to help and thanks for your hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MethodsValidtor rejects QUERY

2 participants