-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Kestrel and IIS set different Request.Protocol values for HTTP/2 #14139
Comments
Bug. The official value is |
@Tratcher is there anything we can do if IIS sets it? |
I misunderstood the original issue. I see now. |
Kind of. I have a test for protocol, and IIS (specifically IIS express) is failing that test even though it is HTTP/2. It doesn't actually break anyone at the moment because IIS express can't support gRPC, but it gives people an odd error message. grpc/grpc-dotnet#526 (comment) Current: if (httpContext.Request.Protocol != "HTTP/2")
{
// Set error response on HttpResponse
return Task.CompletedTask;
} I can change it to: if (httpContext.Request.Protocol != "HTTP/2" && httpContext.Request.Protocol != "HTTP/2.0")
{
// Set error response on HttpResponse
return Task.CompletedTask;
} IIS will still fail but it will fail for a less odd reason. |
So all we need to do is add a clause to the IISHttpContext.FeatureCollection code @Tratcher linked above to have it explicitly return |
@anure I'm going to do this. |
In @gfoidl we trust. |
That turnaround was awesome :). Nice work and thanks @gfoidl! |
I've just finished a gRPC service in .NET Core 3.0 and I'd like to host it with IIS inprocess, but I got this 426 error. It was correctualy qualified as a bug, but will only be included in 5.0-preview? Shall I drop my intention to use IIS so? |
@tiago-quintanilha I don't think your question is related to this issue thread. Can you open a new issue please? |
IIS doesn't support gRPC. It needs improvements to support HTTP/2 trailers and bi-directional streaming. |
@anurse, I posted here because the error was exactly the same, since gRPC always uses http/2, and I noticed that '3.1-candidate' tag was exchanged for '5.0.0-preview1'. @JamesNK, thanks for your feedback. I've searched for this very information but I could't find. Guess it is all too new. I'll have to use windows service then. |
The initial post was just about being more consistent with how we report Anyway, I think we got to the bottom of your issue @tiago-quintanilha, but feel free to file a new issue if you need to! Even if your issue is related to this one, once this issue is closed it's better to just file a new one rather than posting on a closed issue (since we don't triage these anymore). |
Re-opening because I think this should be unit tested to prevent regression. gRPC tests this string to verify the request is HTTP/2. It is important it is correct. |
For testing, I think the most useful verification would be a couple of integration/functional tests that check Kestrel and IIS product the same |
I can do this. It's fairly non-trivial to verify Http/2+IIS. |
Kestrel sets
HTTP/2
while IIS setsHTTP/2.0
.Is this expected behavior?
The text was updated successfully, but these errors were encountered: