use Nokogiri::HTML::fragment in process_headers