restore some of the old code that was allowing debugging and removing transfer-encoding header.