Add headers
check for buffer before setting content-length header
making sure content length is right with buffer and string