EDIT: I answered my own question, but am following up with a suggestion
I am kind of curious why there is a check for the source being a regular file in addition to the underlying writer being a ReaderFrom. This is defeating the use of splice() on Linux when copying the output of a socket into a response (socket to socket can splice).
If the source turns out not to be splice-or-sendfile’able after all, there’s nothing lost if we proceed along, as we know the writer is at least a ReaderFrom and the ReadFrom() calls will devolve into our buffered copy anyway, thus no worse off than the current behavior.
It seems to me this check is unnecessary and, in this case, is actually hurting? I can’t find any harm if that check is removed.