Cleaned up the HTTP header generation a bit