Added Last-Modified parsing in add_header. This allows to use last modified time set in If-Range checks. Code simplified to improve readability.