ResponseHeader() fails when header is longer than a header in the response


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:
  1. Not appending a ":" to the passed in header.
  2. Using the IndexOf(':') to set the substring length
  3. Starting the check with _Headers[1], since _Headers[0] is the response code and doesn't have a ":" in it.


Garrcomm wrote Jun 21, 2014 at 4:17 PM

Hi Frogmore,

I don't really understand the issue. Do you have a sample of a HTTP response on which it failed?