parse both HEAD and HEADER