Skip to content

Commit 2cf6f50

Browse files
authored
Merge pull request #263 from ankadada/master
add ucwordsHyphen
2 parents 67852ba + daa3e77 commit 2cf6f50

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Qiniu/Http/Client.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private static function parseHeaders($raw)
129129
$headerLine = trim($line);
130130
$kv = explode(':', $headerLine);
131131
if (count($kv) > 1) {
132-
$kv[0] = ucwords($kv[0], '-');
132+
$kv[0] =self::ucwordsHyphen($kv[0]);
133133
$headers[$kv[0]] = trim($kv[1]);
134134
}
135135
}
@@ -142,4 +142,9 @@ private static function escapeQuotes($str)
142142
$replace = array("\\\\", "\\\"");
143143
return str_replace($find, $replace, $str);
144144
}
145+
146+
private static function ucwordsHyphen($str)
147+
{
148+
return str_replace('- ', '-', ucwords(str_replace('-', '- ', $str)));
149+
}
145150
}

0 commit comments

Comments
 (0)