HTTPRequest: Validate length before status code

partially fixes #1159