3.0 Preview 7: Can't get HTTP/2 trailer headers to appear
See original GitHub issueWhile Trailer
headers appear to be supported (as should be the case with HTTP/2 over HTTPS), context.Response.SupportsTrailers()
is true, the actual header after response body doesn’t appear to send. However, support is wonky enough across platforms I’m not 100% sure I trust the debugging tools either.
To Reproduce
- Using 3.0 Preview 7 SDK
- Grab this repo: MiniProfiler/dotnet
- In Visual Studio, fire up
samples\Samples.AspNetCore3
- When making a request to
https://localhost:5001
, you’ll see aTrailer: Server-Timing
header, but not the actualServer-Timing
header that should be sent after the body.
Note: this requires the local HTTPS self-signed cert to work, dotnet dev-certs https
if Kestrel won’t bind because it’ out of date.
Relevant code section is MiniProfilerMiddleware.cs line #93-96.
Expected behavior
A Server-Timing
header is sent (so that app timings show up in browser tools)
Additional context
As said before - I don’t trust the debug tools here either, so after chatting with @anurse I’m filing to be sure. I don’t see the headers in Chrome, Firefox, or raw curl
. There is no error anywhere and all code appears to be running, but it’s as if Kestrel isn’t flushing that header in some way…or I’m an idiot. I give it 10/90 odds on the split.
Thanks for the tip on HttpClient
, I’ll try spinning up a client with it on latest preview tonight to see if it can see the headers. My understanding is at least Chrome should be working with the current code though.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Thanks for the tips all - I was able to test this tonight. Test harness:
And the result against the sample app:
So…the issue is likely in Chrome somewhere not rendering these. Kestrel appears to be doing the right thing.
We can close this out to cleanup. I appreciate the debugging tips, that helps a lot tracking things down.
When I setup Wireshark I tried for hours to read TLS but couldn’t get it to work 😢