title: What does the “+2” and “:” in [:http_payload.index("\r\n\r\n")+2]mean in this code?
body: <p>Why in the first case its "+2" while below its "+4:"?</p>
  
  <pre><code>def get_http_headers(http_payload):
      try:
          # split the headers off if it is HTTP traffic
          headers_raw = http_payload[:http_payload.index("\r\n\r\n")+2]
  
          # break out the headers
          headers = dict(re.findall(r"(?P&lt;name&gt;.*?): (?P&lt;value&gt;.*?)\r\n", headers_raw))
  
      except:
          return None
  
      return headers
  
  def extract_image(headers, http_payload):
      image = None
      image_type = None
  
      try:
          if "image" in headers["Content-Type"]:
              # grab the image type and image body
              image_type = headers["Content-Type"].split("/")[1]
  
              image = http_payload[http_payload.index("\r\n\r\n")+4:]
  </code></pre>