Skip to content

Commit 3163b6d

Browse files
authored
Merge pull request zounar#1 from ajaxray/master
Keep mime-type and filename of original file
2 parents da9b65e + 89fdd28 commit 3163b6d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

proxy.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ function exceptionHandler(Exception $ex)
193193
$filePath = realpath($file['tmp_name']);
194194

195195
if (CURLFILE) {
196-
$data[$fileName] = new CURLFile($filePath);
196+
$data[$fileName] = new CURLFile($filePath, $file['type'], $file['name']);
197197
} else {
198198
$data[$fileName] = '@' . $filePath;
199199
}
@@ -281,7 +281,7 @@ function exceptionHandler(Exception $ex)
281281

282282
if ($debug) {
283283
echo 'Headers sent to proxy' . PHP_EOL . PHP_EOL;
284-
echo implode($httpHeadersAll, PHP_EOL);
284+
echo implode(PHP_EOL, $httpHeadersAll);
285285
echo HR;
286286

287287
echo '$_GET sent to proxy' . PHP_EOL . PHP_EOL;
@@ -293,15 +293,15 @@ function exceptionHandler(Exception $ex)
293293
echo HR;
294294

295295
echo 'Headers sent to target' . PHP_EOL . PHP_EOL;
296-
echo implode($requestHeaders, PHP_EOL);
296+
echo implode(PHP_EOL, $requestHeaders);
297297
echo HR;
298298

299299
echo 'Headers received from target' . PHP_EOL . PHP_EOL;
300-
echo implode($responseHeaders, PHP_EOL);
300+
echo implode(PHP_EOL, $responseHeaders);
301301
echo HR;
302302

303303
echo 'Headers sent from proxy to client' . PHP_EOL . PHP_EOL;
304-
echo implode(headers_list(), PHP_EOL);
304+
echo implode(PHP_EOL, headers_list());
305305
echo HR;
306306

307307
echo 'Body sent from proxy to client' . PHP_EOL . PHP_EOL;

0 commit comments

Comments
 (0)