Skip to content

Improve IHttpRequestBodyDetectionFeature.CanHaveBody XML comment #44773

@JamesNK

Description

@JamesNK

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

IHttpRequestBodyDetectionFeature.CanHaveBody has a lot of useful information in the XML doc:

/// <summary>
/// Indicates if the request can have a body.
/// </summary>
/// <remarks>
/// This returns true when:
/// - It's an HTTP/1.x request with a non-zero Content-Length or a 'Transfer-Encoding: chunked' header.
/// - It's an HTTP/2 request that did not set the END_STREAM flag on the initial headers frame.
/// The final request body length may still be zero for the chunked or HTTP/2 scenarios.
///
/// This returns false when:
/// - It's an HTTP/1.x request with no Content-Length or 'Transfer-Encoding: chunked' header, or the Content-Length is 0.
/// - It's an HTTP/1.x request with Connection: Upgrade (e.g. WebSockets). There is no HTTP request body for these requests and
/// no data should be received until after the upgrade.
/// - It's an HTTP/2 request that set END_STREAM on the initial headers frame.
/// When false, the request body should never return data.
/// </remarks>

Unfortunately, whitespace is ignored in XML doc comments, so becomes a mess in tooling:

image

Expected Behavior

Add <para>, <c> and <list> tags to comment to make it display well in tooling.

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/recommended-tags

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsgood first issueGood for newcomers.help wantedUp for grabs. We would accept a PR to help resolve this issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions