Skip to content

Add HttpSys wrapper interface for HttpQueryRequestProperty Windows API#66700

Merged
DeagleGross merged 6 commits into
dotnet:mainfrom
DeagleGross:dmkorolev/httpqueryrequestproperty
May 27, 2026
Merged

Add HttpSys wrapper interface for HttpQueryRequestProperty Windows API#66700
DeagleGross merged 6 commits into
dotnet:mainfrom
DeagleGross:dmkorolev/httpqueryrequestproperty

Conversation

@DeagleGross

@DeagleGross DeagleGross commented May 15, 2026

Copy link
Copy Markdown
Member

Added support for reading an arbitrary HTTP_REQUEST_PROPERTY value from HTTP.SYS using the HttpQueryRequestProperty.

Closes #63181

@DeagleGross DeagleGross self-assigned this May 15, 2026
Copilot AI review requested due to automatic review settings May 15, 2026 15:45
@DeagleGross DeagleGross requested a review from halter73 as a code owner May 15, 2026 15:45
@DeagleGross DeagleGross added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label May 15, 2026

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.

Pull request overview

Adds a new generic wrapper around the Windows HttpQueryRequestProperty API to IHttpSysRequestPropertyFeature, exposing both synchronous and asynchronous methods so callers can query any HTTP_REQUEST_PROPERTY value (TLS cipher info, stream errors, TCP stats, etc.) without per-property feature work. Implements the API closing issue #63181 (note that the async overload is experimental per the PR description).

Changes:

  • New TryGetRequestProperty / TryGetRequestPropertyAsync interface members plus a HttpSysRequestPropertyResult result struct (public API).
  • RequestContext core implementations and a new RequestPropertyQueryAsyncContext IOCP-driven IValueTaskSource<T> for async completion.
  • Tests, sample middleware, new logger event id, and a fix for the duplicate TlsClientHelloRetrieveError logger event id.
Show a summary per file
File Description
src/Servers/HttpSys/src/IHttpSysRequestPropertyFeature.cs Adds public sync/async query methods to the feature interface with XML docs.
src/Servers/HttpSys/src/HttpSysRequestPropertyResult.cs New public result struct for the async overload.
src/Servers/HttpSys/src/SourceBuildStubs.cs Mirrors the new interface members + result struct for source-build.
src/Servers/HttpSys/src/PublicAPI.Unshipped.txt Tracks the new public API surface.
src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs Sync core wrapper + async dispatch into the new context.
src/Servers/HttpSys/src/RequestProcessing/RequestContext.FeatureCollection.cs Wires the interface implementations into the feature collection.
src/Servers/HttpSys/src/RequestProcessing/RequestPropertyQueryAsyncContext.cs New IValueTaskSource<HttpSysRequestPropertyResult> driving the async path with IOCP.
src/Servers/HttpSys/src/RequestProcessing/RequestContext.Log.cs Fixes mis-used event id and adds QueryRequestPropertyError.
src/Servers/HttpSys/src/LoggerEventIds.cs Adds QueryRequestPropertyError event id.
src/Servers/HttpSys/test/FunctionalTests/HttpsTests.cs E2E tests covering sync/async success, buffer-too-small, and pre-cancellation.
src/Servers/HttpSys/samples/TlsFeaturesObserve/Program.cs Sample middleware exercising the new sync/async query methods.

Copilot's findings

  • Files reviewed: 11/11 changed files
  • Comments generated: 2

Comment thread src/Servers/HttpSys/src/RequestProcessing/RequestPropertyQueryAsyncContext.cs Outdated
Comment on lines +24 to 25
[LoggerMessage(LoggerEventIds.TlsListenerError, LogLevel.Debug, "Failed to invoke QueryTlsClientHello; RequestId: {RequestId}; Win32 Error code: {Win32Error}", EventName = "TlsClientHelloRetrieveError")]
public static partial void TlsClientHelloRetrieveError(ILogger logger, ulong requestId, uint win32Error);
Comment thread src/Servers/HttpSys/src/IHttpSysRequestPropertyFeature.cs Outdated
@DeagleGross DeagleGross merged commit d17cc21 into dotnet:main May 27, 2026
25 checks passed
@DeagleGross DeagleGross deleted the dmkorolev/httpqueryrequestproperty branch May 27, 2026 07:48
DeagleGross added a commit to DeagleGross/aspnetcore that referenced this pull request May 27, 2026
…ate)

Merges upstream commits:

* d17cc21 — Add HttpSys wrapper for HttpQueryRequestProperty (dotnet#66700)
* 0fcd398 — Recompile workflows with gh aw v0.76.1 (dotnet#66864)
* e4591cc — dotnet/optimization dependency update
* c3a3603 — Update issue-triage-agent.md (dotnet#66852) (already merged previously)

Conflict resolution:

* All 5 .lock.yml files conflicted because both branches recompiled
  them. Took upstream's lock files (their v0.76.1 recompile is the
  canonical baseline), then re-ran `gh aw compile` on our two source
  files (issue-triage-agent.md and triage-comment-reviewer.md) so our
  .md changes (orchestrator/worker split, reviewer policy, OpenAPI
  disambiguation tip, etc.) are re-layered on top of v0.76.1.

* .github/agents/agentic-workflows.agent.md was auto-updated by
  `gh aw compile` to point at v0.76.1 documentation URLs and to pick
  up the new dispatcher routing entries (asciicharts, cli-commands,
  token-optimization, patterns) that gh-aw upstream added between
  v0.71.1 and v0.76.1. Upstream hadn't bumped this file yet in their
  recompile commit, so the diff is legitimate and forward-looking.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API Suggestion: Add HttpSys wrapper interface for HttpQueryRequestProperty Windows API

3 participants