-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Response trailers for netstandard20 #18
Add support for Response trailers for netstandard20 #18
Conversation
When using the netstandard20 version, response trailers were previously ignored. This was causing issues with handling responses from a GRPC service. Grpc-dotnet works with WinHttpHandler on recent Windows versions, and trailers are stored in the request generic property bag as shown here: https://github.com/grpc/grpc-dotnet/blob/456098bcfeb9c796c19ea023b3ab3703181f1089/src/Shared/TrailingHeadersHelpers.cs#L30 This PR uses the same way to store trailers when compiled for netstandard 2.0 Signed-off-by: Simon Ferquel <[email protected]>
Thanks, can you explain what the use-case is? |
This is a Unity use case, where we have some programs running grpc services on a named pipe - without encryption (on Windows platform). Those services can be consumed in MSBuild tasks, which run on .NET 4.7.2 within Visual Studio. |
that responseMessage.RequestMessage.Properties["__ResponseTrailers"] logic seems very use-case specific... isn't it? |
@TalAloni it is the "official" place to put response trailing headers when running on .NET Framework: reference
Any chance you could re-review this PR please, with that added context? |
|
||
private async Task SendDataAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken) | ||
} | ||
class HttpTrailers : HttpHeaders |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a separate file and should only be defined for NETSTANDARD2_0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
@@ -1,4 +1,4 @@ | |||
// Licensed to the .NET Foundation under one or more agreements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have removed the BOM from the beginning of the file, please revert this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
@TalAloni thank you for merging! Please could you release a new version of the hidden 3.1.0.x package on NuGet? |
Done (v3.1.0.5) |
Thank you! |
When using the netstandard20 version, response trailers were previously ignored. This was causing issues with handling responses from a GRPC service.
Grpc-dotnet works with WinHttpHandler on recent Windows versions, and trailers are stored in the request generic property bag as shown here: https://github.com/grpc/grpc-dotnet/blob/456098bcfeb9c796c19ea023b3ab3703181f1089/src/Shared/TrailingHeadersHelpers.cs#L30
This PR uses the same way to store trailers when compiled for netstandard 2.0
Signed-off-by: Simon Ferquel [email protected]