made CGI header parsing more fault tolerant