Properly crafting HTTP reply line by parsing CGI reply headers