fix bug in keep-alive header handling