mailchimp-api icon indicating copy to clipboard operation
mailchimp-api copied to clipboard

Error in MailChimp::getHeadersAsArray()

Open harrydowe opened this issue 7 years ago • 3 comments

Line 337 in MailChimp::getHeadersAsArray() throws an error:

list($key, $value) = explode(': ', $line);

Since $line is not set to a key: value format string. It's set to HTTP/1.0 200 OK. This is probably due to the zscaler proxy I have here. I can see that the if ($i === 0) is meant to catch this kind of thing, which it does as the first header is HTTP/1.1 200 Connection Established.

How about adding a check to see if this is a valid header?

if (strpos($line, ': ') === false) {
    continue;
}

harrydowe avatar Apr 16 '18 14:04 harrydowe

I too had this issue. Fixed in https://github.com/drewm/mailchimp-api/pull/243/files#diff-4658eb423d377d316ca4cdeb41f5c5daR344

calinblaga avatar May 03 '18 09:05 calinblaga

Looks like you closed that PR?

harrydowe avatar May 16 '18 14:05 harrydowe

Reopened https://github.com/drewm/mailchimp-api/pull/243

calinblaga avatar May 17 '18 06:05 calinblaga