Fixed bug during determine Content-Length in case of arg size is not set

Added check: offset cannot be greater than total_size of file
Version up to 2.0.18