Skip to content

Skip query parsing for POST requests without a query string - #10620

Merged
tobias-tengler merged 1 commit into
mainfrom
tte/post-skip-query-parsing
Oct 20, 2026
Merged

tobias-tengler merged 1 commit into
mainfrom
tte/post-skip-query-parsing

Conversation

@tobias-tengler

@tobias-tengler tobias-tengler commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

For a request body with a single GraphQL request, the HTTP POST middleware checks for the batchOperations query parameter, which creates the query feature and parses the query collection on every POST request, even when the request has no query string.

This PR checks QueryString.HasValue first and reads the query collection only when the request has a query string.

Method Version Allocated (round 1) Allocated (round 2) Mean Delta
POST through the gateway before 23,276 B 23,247 B 23,262 B
POST through the gateway PR 23,217 B 23,119 B 23,168 B −94 B

The batchOperations check created the query feature on every POST request. It now
reads the query collection only when the request has a query string.
@github-actions

Copy link
Copy Markdown
Contributor

Patch coverage

100.0% of changed lines covered (2/2)

File Covered Changed Patch %
…/AspNetCore/src/AspNetCore.Pipeline/HttpPostMiddlewareBase.cs 2 2 100.0% 🟢

Project coverage: 59.0% (311549/527849 lines)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@tobias-tengler
tobias-tengler merged commit b8dbd05 into main Oct 20, 2026
158 checks passed
@tobias-tengler
tobias-tengler deleted the tte/post-skip-query-parsing branch October 20, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants