8000 fix upload file bug · perico63/codebird-php@1a5dc30 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1a5dc30

Browse files
committed
fix upload file bug
2 parents f666559 + 8cf0d58 commit 1a5dc30

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/codebird.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,8 +2217,12 @@ protected function _callApiPreparationsPost(
22172217
} elseif ($this->_detectBinaryBody($method_template)) {
22182218
// transform parametric headers to real headers
22192219
foreach ([
2220-
'Content-Type', 'X-TON-Content-Type',
2221-
'X-TON-Content-Length', 'Content-Range'
2220+
'Content-Length',
2221+
'Content-Range',
2222+
'Content-Type',
2223+
'X-TON-Content-Type',
2224+
'X-TON-Content-Length',
2225+
'X-TON-Expires'
22222226
] as $key) {
22232227
if (isset($params[$key])) {
22242228
$request_headers[] = $key . ': ' . $params[$key];
@@ -2568,9 +2572,9 @@ protected function _parseApiHeaders($reply) {
25682572
*/
25692573
protected function _parseApiReplyPrefillHeaders($headers, $reply)
25702574
{
2571-
if ($reply === '' && (isset($headers['Location']))) {
2575+
if ($reply === '' && (isset($headers['Location']) || isset($headers['Location']))) {
25722576
$reply = [
2573-
'Location' => $headers['Location']
2577+
'Location' => isset($headers['Location']) ? $headers['Location'] : $headers['location']
25742578
];
25752579
if (isset($headers['X-TON-Min-Chunk-Size'])) {
25762580
$reply['X-TON-Min-Chunk-Size'] = $headers['X-TON-Min-Chunk-Size'];

0 commit comments

Comments
 (0)
0