proper parsing of headers from client