(request *http.Request)
| 125 | } |
| 126 | |
| 127 | func (*grpcHandler) SetTimeout(request *http.Request) (context.Context, context.CancelFunc, error) { |
| 128 | timeout, err := grpcParseTimeout(getHeaderCanonical(request.Header, grpcHeaderTimeout)) |
| 129 | if err != nil && !errors.Is(err, errNoTimeout) { |
| 130 | // Errors here indicate that the client sent an invalid timeout header, so |
| 131 | // the error text is safe to send back. |
| 132 | return nil, nil, NewError(CodeInvalidArgument, err) |
| 133 | } else if err != nil { |
| 134 | // err wraps errNoTimeout, nothing to do. |
| 135 | return request.Context(), nil, nil //nolint:nilerr |
| 136 | } |
| 137 | ctx, cancel := context.WithTimeout(request.Context(), timeout) |
| 138 | return ctx, cancel, nil |
| 139 | } |
| 140 | |
| 141 | func (g *grpcHandler) CanHandlePayload(_ *http.Request, contentType string) bool { |
| 142 | _, ok := g.accept[contentType] |
nothing calls this directly
no test coverage detected