transport: add status details even when aborting early (#8754)
Modifies `earlyAbortStreamHandler` to include status details if present.
Most use cases of `earlyAbortStreamHandler` are for circumstances where
there are certainly no error details (bad HTTP methods, bad
content-type, internal error, etc). However, tap handlers also typically
go through the `earlyAbortStreamHandler`. In `http2_server.go`:
```
if t.inTapHandle != nil {
var err error
if s.ctx, err = t.inTapHandle(s.ctx, &tap.Info{FullMethodName: s.method, Header: mdata}); err != nil {
t.mu.Unlock()
if t.logger.V(logLevel) {
t.logger.Infof("Aborting the stream early due to InTapHandle failure: %v", err)
}
stat, ok := status.FromError(err)
if !ok {
stat = status.New(codes.PermissionDenied, err.Error())
}
t.controlBuf.put(&earlyAbortStream{
// ...
status: stat, // <-- CAN have details!
})
```
Yet the handler does **not** include error details by default, limiting
how tap handlers can be used and breaking some user assumptions
surrounding which information is propagated.
This PR fixes this by checking for status details and including the
header for them if present.
RELEASE NOTES:
* transport: propagate status details from tap handlers.