1
0
Fork 0

Add support for headers as strings to avoid regressions, refs #1387

pull/1385/merge
Jordi Boggiano 2012-12-05 16:57:54 +01:00
parent 9c3201f6d7
commit 308e2ff4cb
1 changed files with 3 additions and 0 deletions

View File

@ -70,6 +70,9 @@ final class StreamContextFactory
// Preserve headers if already set in default options
if (isset($defaultOptions['http']['header'])) {
if (is_string($defaultOptions['http']['header'])) {
$defaultOptions['http']['header'] = array($defaultOptions['http']['header']);
}
$defaultOptions['http']['header'][] = "Proxy-Authorization: Basic {$auth}";
} else {
$options['http']['header'] = array("Proxy-Authorization: Basic {$auth}");