Since the test is using the length of the passed in header to get the substring of the headers in this._Headers, it can get an exception if the passed in header is longer than one of the response's headers.
I fixed this issue by:
- Not appending a ":" to the passed in header.
- Using the IndexOf(':') to set the substring length
- Starting the check with _Headers, since _Headers is the response code and doesn't have a ":" in it.