trim headers

Sometimes the response headers contains leading and/or trailing blanks:
`{<<"Transfer-Encoding">>,<<" chunked">>}`
This leads to problems in request processing. To avoid this it is necessary to trim them.