This reverts commit f623fd76. But only the changes made in lib/ they were falsely detecting outgoing headers.