Add a missing boundary check for Range requests

Fixes #1323
Spotted & fix by:	gquintard