close channel if content-length > max length, extend unit tests