make sure we have a copy of the raw request header
code cleanup