Skip to content

Conversation

@Asafima
Copy link
Contributor

@Asafima Asafima commented May 11, 2025

Improved the documentation for request body transforms by clarifying limitations, common pitfalls, and safe patterns of use.

Request Body Transforms

  • Can only modify an existing request body, not add one where none exists.
  • Clearly documented:
    • How to safely inject a new request body via custom middleware before YARP
    • Necessary use of IHttpRequestBodyDetectionFeature to ensure ASP.NET Core and YARP recognize the new body
  • Provided code examples for adding a new request body in middleware.

Related issues

Notes


Internal previews

📄 File 🔗 Preview link
aspnetcore/fundamentals/servers/yarp/extensibility-transforms.md aspnetcore/fundamentals/servers/yarp/extensibility-transforms

Clarify request body transforms require existing body or IHttpRequestBodyDetectionFeature
@Asafima
Copy link
Contributor Author

Asafima commented May 11, 2025

@dotnet-policy-service agree

@guardrex guardrex requested a review from samsp-msft May 11, 2025 23:08
@guardrex

This comment was marked as outdated.

@guardrex guardrex self-assigned this May 19, 2025
Copy link
Member

@MihaZupan MihaZupan left a comment

Choose a reason for hiding this comment

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

Thank you

@MihaZupan MihaZupan enabled auto-merge May 19, 2025 21:04
@MihaZupan MihaZupan merged commit 59d6e15 into dotnet:main May 19, 2025
3 checks passed
@guardrex guardrex removed the request for review from samsp-msft May 19, 2025 21:07
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.

3 participants