Clamp end of range request to be the length of the file
Merge pull request #3126 from mduan/issue3118-2

Clamp end of range request to be the length of the file