I have been looking into custom Range implementation and abstracting it away in a reusable module.
For a lot of cases it makes sense to implement this in MediaTypeFormatter. ContentRange header sits on Content headers, so MediaTypeFormatter has access to it.
But MediaTypeFormatter does not have access to the request and its headers so it cannot find out about the
I appreciate that it is best to limit access of various parts of the system to the bits they do not need (access to the whole request is definitely not good in a mediatypeformatter) but I believe access to request headers (and in this case Range header)
is useful and sometimes required.
So how do you see that working?