mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-02 21:19:58 +09:00
Update to laravel 7
This commit is contained in:
@@ -36,10 +36,14 @@ class CurlCommandFormatter implements Formatter
|
||||
|
||||
$body = $request->getBody();
|
||||
if ($body->getSize() > 0) {
|
||||
if ($body->isSeekable()) {
|
||||
// escapeshellarg argument max length on Windows, but longer body in curl command would be impractical anyways
|
||||
if ($body->getSize() > 8192) {
|
||||
$data = '[too long stream omitted]';
|
||||
} elseif ($body->isSeekable()) {
|
||||
$data = $body->__toString();
|
||||
$body->rewind();
|
||||
if (preg_match('/[\x00-\x1F\x7F]/', $data)) {
|
||||
// all non-printable ASCII characters and <DEL> except for \t, \r, \n
|
||||
if (preg_match('/([\x00-\x09\x0C\x0E-\x1F\x7F])/', $data)) {
|
||||
$data = '[binary stream omitted]';
|
||||
}
|
||||
} else {
|
||||
@@ -65,10 +69,18 @@ class CurlCommandFormatter implements Formatter
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RequestInterface $request
|
||||
* Formats a response in context of its request.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function formatResponseForRequest(ResponseInterface $response, RequestInterface $request)
|
||||
{
|
||||
return $this->formatResponse($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
private function getHeadersAsCommandOptions(RequestInterface $request)
|
||||
{
|
||||
$command = '';
|
||||
|
||||
Reference in New Issue
Block a user