input: Write a function to parse an http header to a python dictionary.
  assert parse_http_header('Accept: application/json\nContent-Type: text/html\nContent-Length: 15\n') == {'Accept': 'application/json', 'Content-Type': 'text/html', 'Content-Length': '15'}
  assert parse_http_header('Host: example.com\nUser-Agent: Mozilla/5.0\nAccept-Language: en-US\n') == {'Host': 'example.com', 'User-Agent': 'Mozilla/5.0', 'Accept-Language': 'en-US'}
  assert parse_http_header('') == {}
output: def parse_http_header(header_str):
      header_dict = {}
      if header_str:
          lines = header_str.strip().split('\n')
          for line in lines:
              key, value = line.split(': ', 1)
              header_dict[key] = value
      return header_dict