Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace GuzzleHttp\Tests; use GuzzleHttp\Client; use GuzzleHttp\Exception\BadResp..

Decoded Output download

<?php
 namespace GuzzleHttp\Tests; use GuzzleHttp\Client; use GuzzleHttp\Exception\BadResponseException; use GuzzleHttp\Exception\TooManyRedirectsException; use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\HandlerStack; use GuzzleHttp\Middleware; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; use GuzzleHttp\RedirectMiddleware; use PHPUnit\Framework\TestCase; use Psr\Http\Message\RequestInterface; class RedirectMiddlewareTest extends TestCase { public function testIgnoresNonRedirects() { $response = new Response(200); $stack = new HandlerStack(new MockHandler(array($response))); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("GET", "http://example.com"); $promise = $handler($request, array()); $response = $promise->wait(); self::assertSame(200, $response->getStatusCode()); } public function testIgnoresWhenNoLocation() { $response = new Response(304); $stack = new HandlerStack(new MockHandler(array($response))); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("GET", "http://example.com"); $promise = $handler($request, array()); $response = $promise->wait(); self::assertSame(304, $response->getStatusCode()); } public function testRedirectsWithAbsoluteUri() { $mock = new MockHandler(array(new Response(302, array("Location" => "http://test.com")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("GET", "http://example.com?a=b"); $promise = $handler($request, array("allow_redirects" => array("max" => 2))); $response = $promise->wait(); self::assertSame(200, $response->getStatusCode()); self::assertSame("http://test.com", (string) $mock->getLastRequest()->getUri()); } public function testRedirectsWithRelativeUri() { $mock = new MockHandler(array(new Response(302, array("Location" => "/foo")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("GET", "http://example.com?a=b"); $promise = $handler($request, array("allow_redirects" => array("max" => 2))); $response = $promise->wait(); self::assertSame(200, $response->getStatusCode()); self::assertSame("http://example.com/foo", (string) $mock->getLastRequest()->getUri()); } public function testLimitsToMaxRedirects() { $mock = new MockHandler(array(new Response(301, array("Location" => "http://test.com")), new Response(302, array("Location" => "http://test.com")), new Response(303, array("Location" => "http://test.com")), new Response(304, array("Location" => "http://test.com")))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("GET", "http://example.com"); $promise = $handler($request, array("allow_redirects" => array("max" => 3))); $this->expectException(TooManyRedirectsException::class); $this->expectExceptionMessage("Will not follow more than 3 redirects"); $promise->wait(); } public function testTooManyRedirectsExceptionHasResponse() { $mock = new MockHandler(array(new Response(301, array("Location" => "http://test.com")), new Response(302, array("Location" => "http://test.com")))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("GET", "http://example.com"); $promise = $handler($request, array("allow_redirects" => array("max" => 1))); try { $promise->wait(); self::fail(); } catch (TooManyRedirectsException $e) { self::assertSame(302, $e->getResponse()->getStatusCode()); } } public function testEnsuresProtocolIsValid() { $mock = new MockHandler(array(new Response(301, array("Location" => "ftp://test.com")))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("GET", "http://example.com"); $this->expectException(BadResponseException::class); $this->expectExceptionMessage("Redirect URI,"); $handler($request, array("allow_redirects" => array("max" => 3)))->wait(); } public function testAddsRefererHeader() { $mock = new MockHandler(array(new Response(302, array("Location" => "http://test.com")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("GET", "http://example.com?a=b"); $promise = $handler($request, array("allow_redirects" => array("max" => 2, "referer" => true))); $promise->wait(); self::assertSame("http://example.com?a=b", $mock->getLastRequest()->getHeaderLine("Referer")); } public function testAddsRefererHeaderButClearsUserInfo() { $mock = new MockHandler(array(new Response(302, array("Location" => "http://test.com")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("GET", "http://foo:[email protected]?a=b"); $promise = $handler($request, array("allow_redirects" => array("max" => 2, "referer" => true))); $promise->wait(); self::assertSame("http://example.com?a=b", $mock->getLastRequest()->getHeaderLine("Referer")); } public function testAddsGuzzleRedirectHeader() { $mock = new MockHandler(array(new Response(302, array("Location" => "http://example.com")), new Response(302, array("Location" => "http://example.com/foo")), new Response(302, array("Location" => "http://example.com/bar")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("GET", "http://example.com?a=b"); $promise = $handler($request, array("allow_redirects" => array("track_redirects" => true))); $response = $promise->wait(true); self::assertSame(array("http://example.com", "http://example.com/foo", "http://example.com/bar"), $response->getHeader(RedirectMiddleware::HISTORY_HEADER)); } public function testAddsGuzzleRedirectStatusHeader() { $mock = new MockHandler(array(new Response(301, array("Location" => "http://example.com")), new Response(302, array("Location" => "http://example.com/foo")), new Response(301, array("Location" => "http://example.com/bar")), new Response(302, array("Location" => "http://example.com/baz")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("GET", "http://example.com?a=b"); $promise = $handler($request, array("allow_redirects" => array("track_redirects" => true))); $response = $promise->wait(true); self::assertSame(array("301", "302", "301", "302"), $response->getHeader(RedirectMiddleware::STATUS_HISTORY_HEADER)); } public function testDoesNotAddRefererWhenGoingFromHttpsToHttp() { $mock = new MockHandler(array(new Response(302, array("Location" => "http://test.com")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("GET", "https://example.com?a=b"); $promise = $handler($request, array("allow_redirects" => array("max" => 2, "referer" => true))); $promise->wait(); self::assertFalse($mock->getLastRequest()->hasHeader("Referer")); } public function testInvokesOnRedirectForRedirects() { $mock = new MockHandler(array(new Response(302, array("Location" => "http://test.com")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("GET", "http://example.com?a=b"); $call = false; $promise = $handler($request, array("allow_redirects" => array("max" => 2, "on_redirect" => static function ($request, $response, $uri) use(&$call) { self::assertSame(302, $response->getStatusCode()); self::assertSame("GET", $request->getMethod()); self::assertSame("http://test.com", (string) $uri); $call = true; }))); $promise->wait(); self::assertTrue($call); } public function testRemoveCurlAuthorizationOptionsOnRedirectCrossHost($auth) { if (!defined("\CURLOPT_HTTPAUTH")) { self::markTestSkipped("ext-curl is required for this test"); } $mock = new MockHandler(array(new Response(302, array("Location" => "http://test.com")), static function (RequestInterface $request, $options) { self::assertFalse(isset($options["curl"][\CURLOPT_HTTPAUTH]), "curl options still contain CURLOPT_HTTPAUTH entry"); self::assertFalse(isset($options["curl"][\CURLOPT_USERPWD]), "curl options still contain CURLOPT_USERPWD entry"); return new Response(200); })); $handler = HandlerStack::create($mock); $client = new Client(array("handler" => $handler)); $client->get("http://example.com?a=b", array("auth" => array("testuser", "testpass", $auth))); } public function testRemoveCurlAuthorizationOptionsOnRedirectCrossPort($auth) { if (!defined("\CURLOPT_HTTPAUTH")) { self::markTestSkipped("ext-curl is required for this test"); } $mock = new MockHandler(array(new Response(302, array("Location" => "http://example.com:81/")), static function (RequestInterface $request, $options) { self::assertFalse(isset($options["curl"][\CURLOPT_HTTPAUTH]), "curl options still contain CURLOPT_HTTPAUTH entry"); self::assertFalse(isset($options["curl"][\CURLOPT_USERPWD]), "curl options still contain CURLOPT_USERPWD entry"); return new Response(200); })); $handler = HandlerStack::create($mock); $client = new Client(array("handler" => $handler)); $client->get("http://example.com?a=b", array("auth" => array("testuser", "testpass", $auth))); } public function testRemoveCurlAuthorizationOptionsOnRedirectCrossScheme($auth) { if (!defined("\CURLOPT_HTTPAUTH")) { self::markTestSkipped("ext-curl is required for this test"); } $mock = new MockHandler(array(new Response(302, array("Location" => "http://example.com?a=b")), static function (RequestInterface $request, $options) { self::assertFalse(isset($options["curl"][\CURLOPT_HTTPAUTH]), "curl options still contain CURLOPT_HTTPAUTH entry"); self::assertFalse(isset($options["curl"][\CURLOPT_USERPWD]), "curl options still contain CURLOPT_USERPWD entry"); return new Response(200); })); $handler = HandlerStack::create($mock); $client = new Client(array("handler" => $handler)); $client->get("https://example.com?a=b", array("auth" => array("testuser", "testpass", $auth))); } public function testRemoveCurlAuthorizationOptionsOnRedirectCrossSchemeSamePort($auth) { if (!defined("\CURLOPT_HTTPAUTH")) { self::markTestSkipped("ext-curl is required for this test"); } $mock = new MockHandler(array(new Response(302, array("Location" => "http://example.com:80?a=b")), static function (RequestInterface $request, $options) { self::assertFalse(isset($options["curl"][\CURLOPT_HTTPAUTH]), "curl options still contain CURLOPT_HTTPAUTH entry"); self::assertFalse(isset($options["curl"][\CURLOPT_USERPWD]), "curl options still contain CURLOPT_USERPWD entry"); return new Response(200); })); $handler = HandlerStack::create($mock); $client = new Client(array("handler" => $handler)); $client->get("https://example.com?a=b", array("auth" => array("testuser", "testpass", $auth))); } public function testNotRemoveCurlAuthorizationOptionsOnRedirect($auth) { if (!defined("\CURLOPT_HTTPAUTH") || !defined("\CURLOPT_USERPWD")) { self::markTestSkipped("ext-curl is required for this test"); } $mock = new MockHandler(array(new Response(302, array("Location" => "http://example.com/2")), static function (RequestInterface $request, $options) { self::assertTrue(isset($options["curl"][\CURLOPT_HTTPAUTH]), "curl options does not contain expected CURLOPT_HTTPAUTH entry"); self::assertTrue(isset($options["curl"][\CURLOPT_USERPWD]), "curl options does not contain expected CURLOPT_USERPWD entry"); return new Response(200); })); $handler = HandlerStack::create($mock); $client = new Client(array("handler" => $handler)); $client->get("http://example.com?a=b", array("auth" => array("testuser", "testpass", $auth))); } public function crossOriginRedirectProvider() { return array(array("http://example.com/123", "http://example.com/", false), array("http://example.com/123", "http://example.com:80/", false), array("http://example.com:80/123", "http://example.com/", false), array("http://example.com:80/123", "http://example.com:80/", false), array("http://example.com/123", "https://example.com/", true), array("http://example.com/123", "http://www.example.com/", true), array("http://example.com/123", "http://example.com:81/", true), array("http://example.com:80/123", "http://example.com:81/", true), array("https://example.com/123", "https://example.com/", false), array("https://example.com/123", "https://example.com:443/", false), array("https://example.com:443/123", "https://example.com/", false), array("https://example.com:443/123", "https://example.com:443/", false), array("https://example.com/123", "http://example.com/", true), array("https://example.com/123", "https://www.example.com/", true), array("https://example.com/123", "https://example.com:444/", true), array("https://example.com:443/123", "https://example.com:444/", true)); } public function testHeadersTreatmentOnRedirect($originalUri, $targetUri, $isCrossOrigin) { $mock = new MockHandler(array(new Response(302, array("Location" => $targetUri)), static function (RequestInterface $request) use($isCrossOrigin) { self::assertSame(!$isCrossOrigin, $request->hasHeader("Authorization")); self::assertSame(!$isCrossOrigin, $request->hasHeader("Cookie")); return new Response(200); })); $handler = HandlerStack::create($mock); $client = new Client(array("handler" => $handler)); $client->get($originalUri, array("auth" => array("testuser", "testpass"), "headers" => array("Cookie" => "foo=bar"))); } public function testNotRemoveAuthorizationHeaderOnRedirect() { $mock = new MockHandler(array(new Response(302, array("Location" => "http://example.com/2")), static function (RequestInterface $request) { self::assertTrue($request->hasHeader("Authorization")); return new Response(200); })); $handler = HandlerStack::create($mock); $client = new Client(array("handler" => $handler)); $client->get("http://example.com?a=b", array("auth" => array("testuser", "testpass"))); } public function testModifyRequestFollowRequestMethodAndBody(RequestInterface $request, $expectedFollowRequestMethod) { $redirectMiddleware = new RedirectMiddleware(static function () { }); $options = array("allow_redirects" => array("protocols" => array("http", "https"), "strict" => false, "referer" => null)); $modifiedRequest = $redirectMiddleware->modifyRequest($request, $options, new Response()); self::assertEquals($expectedFollowRequestMethod, $modifiedRequest->getMethod()); self::assertEquals(0, $modifiedRequest->getBody()->getSize()); } public function modifyRequestFollowRequyestMethodAndBodyProvider() { return array("DELETE" => array("request" => new Request("DELETE", "http://example.com/"), "expectedFollowRequestMethod" => "GET"), "GET" => array("request" => new Request("GET", "http://example.com/"), "expectedFollowRequestMethod" => "GET"), "HEAD" => array("request" => new Request("HEAD", "http://example.com/"), "expectedFollowRequestMethod" => "HEAD"), "OPTIONS" => array("request" => new Request("OPTIONS", "http://example.com/"), "expectedFollowRequestMethod" => "OPTIONS"), "PATCH" => array("request" => new Request("PATCH", "http://example.com/"), "expectedFollowRequestMethod" => "GET"), "POST" => array("request" => new Request("POST", "http://example.com/"), "expectedFollowRequestMethod" => "GET"), "PUT" => array("request" => new Request("PUT", "http://example.com/"), "expectedFollowRequestMethod" => "GET")); } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace GuzzleHttp\Tests; use GuzzleHttp\Client; use GuzzleHttp\Exception\BadResponseException; use GuzzleHttp\Exception\TooManyRedirectsException; use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\HandlerStack; use GuzzleHttp\Middleware; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; use GuzzleHttp\RedirectMiddleware; use PHPUnit\Framework\TestCase; use Psr\Http\Message\RequestInterface; class RedirectMiddlewareTest extends TestCase { public function testIgnoresNonRedirects() { $response = new Response(200); $stack = new HandlerStack(new MockHandler(array($response))); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("\x47\x45\x54", "\x68\x74\164\x70\72\57\57\145\170\141\155\160\154\145\56\x63\x6f\x6d"); $promise = $handler($request, array()); $response = $promise->wait(); self::assertSame(200, $response->getStatusCode()); } public function testIgnoresWhenNoLocation() { $response = new Response(304); $stack = new HandlerStack(new MockHandler(array($response))); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("\x47\105\124", "\150\164\x74\x70\x3a\57\x2f\145\170\141\x6d\x70\154\145\x2e\143\x6f\x6d"); $promise = $handler($request, array()); $response = $promise->wait(); self::assertSame(304, $response->getStatusCode()); } public function testRedirectsWithAbsoluteUri() { $mock = new MockHandler(array(new Response(302, array("\x4c\x6f\x63\x61\164\151\157\156" => "\150\x74\x74\160\72\57\x2f\x74\145\x73\164\x2e\x63\x6f\x6d")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("\x47\x45\x54", "\x68\164\164\x70\x3a\57\x2f\x65\x78\141\155\160\x6c\145\x2e\143\x6f\155\77\141\75\x62"); $promise = $handler($request, array("\x61\x6c\x6c\x6f\x77\137\162\145\144\151\162\145\x63\164\163" => array("\155\x61\x78" => 2))); $response = $promise->wait(); self::assertSame(200, $response->getStatusCode()); self::assertSame("\150\164\164\160\x3a\x2f\57\164\145\163\164\56\143\157\155", (string) $mock->getLastRequest()->getUri()); } public function testRedirectsWithRelativeUri() { $mock = new MockHandler(array(new Response(302, array("\114\157\143\x61\164\x69\x6f\156" => "\x2f\146\157\157")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("\x47\105\x54", "\x68\164\164\x70\72\57\57\145\x78\141\x6d\x70\154\x65\x2e\x63\x6f\x6d\x3f\141\x3d\142"); $promise = $handler($request, array("\141\154\x6c\x6f\x77\137\x72\145\x64\x69\x72\145\143\164\x73" => array("\155\x61\x78" => 2))); $response = $promise->wait(); self::assertSame(200, $response->getStatusCode()); self::assertSame("\150\164\x74\160\72\57\57\145\x78\141\x6d\160\154\145\x2e\143\157\x6d\57\x66\157\x6f", (string) $mock->getLastRequest()->getUri()); } public function testLimitsToMaxRedirects() { $mock = new MockHandler(array(new Response(301, array("\x4c\x6f\x63\141\x74\151\157\x6e" => "\150\x74\164\x70\x3a\x2f\57\164\145\x73\x74\x2e\143\157\x6d")), new Response(302, array("\x4c\x6f\143\141\164\151\157\x6e" => "\x68\x74\164\x70\x3a\x2f\x2f\164\x65\x73\x74\x2e\143\x6f\x6d")), new Response(303, array("\114\157\x63\x61\x74\x69\x6f\x6e" => "\x68\x74\164\160\x3a\x2f\57\x74\x65\x73\x74\x2e\143\157\155")), new Response(304, array("\x4c\157\143\141\164\151\x6f\156" => "\x68\164\164\160\x3a\57\57\x74\x65\x73\x74\x2e\143\x6f\155")))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("\x47\x45\124", "\150\164\x74\160\72\x2f\57\x65\x78\141\155\160\154\x65\56\143\x6f\x6d"); $promise = $handler($request, array("\141\154\x6c\157\x77\x5f\x72\145\144\151\162\145\143\164\163" => array("\x6d\x61\170" => 3))); $this->expectException(TooManyRedirectsException::class); $this->expectExceptionMessage("\x57\151\154\154\x20\x6e\x6f\x74\x20\x66\x6f\x6c\154\x6f\x77\x20\x6d\157\162\x65\x20\164\x68\x61\x6e\x20\x33\40\162\145\144\151\162\x65\143\164\163"); $promise->wait(); } public function testTooManyRedirectsExceptionHasResponse() { $mock = new MockHandler(array(new Response(301, array("\114\157\143\x61\x74\x69\157\156" => "\x68\x74\164\x70\72\57\x2f\x74\x65\x73\x74\x2e\x63\x6f\x6d")), new Response(302, array("\114\157\x63\141\164\151\x6f\156" => "\150\164\x74\x70\72\57\x2f\164\145\x73\164\x2e\143\x6f\x6d")))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("\107\105\124", "\x68\x74\x74\x70\x3a\57\57\145\x78\141\x6d\160\x6c\x65\x2e\143\x6f\x6d"); $promise = $handler($request, array("\x61\x6c\x6c\157\167\137\162\x65\x64\x69\x72\145\143\164\x73" => array("\155\x61\x78" => 1))); try { $promise->wait(); self::fail(); } catch (TooManyRedirectsException $e) { self::assertSame(302, $e->getResponse()->getStatusCode()); } } public function testEnsuresProtocolIsValid() { $mock = new MockHandler(array(new Response(301, array("\114\157\x63\141\x74\151\157\x6e" => "\146\164\x70\72\x2f\57\164\x65\x73\164\56\x63\x6f\x6d")))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("\107\x45\124", "\150\x74\164\x70\72\57\x2f\145\170\141\155\x70\154\x65\56\143\x6f\x6d"); $this->expectException(BadResponseException::class); $this->expectExceptionMessage("\x52\145\x64\x69\x72\x65\x63\x74\40\125\x52\x49\x2c"); $handler($request, array("\141\154\154\157\x77\x5f\162\145\x64\x69\162\x65\143\x74\x73" => array("\x6d\141\x78" => 3)))->wait(); } public function testAddsRefererHeader() { $mock = new MockHandler(array(new Response(302, array("\x4c\157\143\141\164\151\157\x6e" => "\x68\164\164\160\72\x2f\x2f\164\145\x73\164\x2e\143\x6f\155")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("\107\x45\124", "\x68\164\164\x70\72\57\x2f\x65\170\x61\x6d\160\154\145\x2e\143\157\x6d\x3f\x61\75\142"); $promise = $handler($request, array("\x61\x6c\x6c\x6f\x77\x5f\x72\145\144\x69\x72\x65\143\164\163" => array("\x6d\x61\x78" => 2, "\x72\145\x66\145\x72\145\162" => true))); $promise->wait(); self::assertSame("\x68\164\x74\x70\x3a\57\57\145\x78\141\x6d\x70\154\x65\56\x63\157\x6d\77\x61\x3d\142", $mock->getLastRequest()->getHeaderLine("\122\x65\x66\x65\162\145\x72")); } public function testAddsRefererHeaderButClearsUserInfo() { $mock = new MockHandler(array(new Response(302, array("\x4c\157\x63\x61\164\151\x6f\x6e" => "\150\x74\x74\x70\x3a\57\x2f\x74\145\163\164\56\x63\x6f\x6d")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("\x47\x45\124", "\x68\x74\164\x70\72\x2f\57\x66\157\x6f\72\x62\x61\x72\x40\x65\x78\141\155\x70\154\x65\56\x63\x6f\x6d\x3f\141\75\142"); $promise = $handler($request, array("\x61\154\x6c\157\167\137\x72\145\144\151\x72\x65\143\x74\x73" => array("\155\141\170" => 2, "\x72\x65\146\145\x72\x65\x72" => true))); $promise->wait(); self::assertSame("\150\164\164\160\x3a\x2f\x2f\145\x78\141\x6d\x70\x6c\145\x2e\x63\157\155\77\x61\75\x62", $mock->getLastRequest()->getHeaderLine("\x52\x65\146\x65\162\x65\x72")); } public function testAddsGuzzleRedirectHeader() { $mock = new MockHandler(array(new Response(302, array("\114\x6f\143\x61\164\x69\157\156" => "\150\x74\164\160\72\x2f\57\x65\x78\141\x6d\160\154\145\56\143\157\x6d")), new Response(302, array("\x4c\x6f\143\x61\164\x69\157\156" => "\150\164\x74\160\72\57\x2f\145\x78\141\x6d\x70\x6c\x65\56\x63\157\x6d\57\x66\x6f\x6f")), new Response(302, array("\114\x6f\143\141\x74\151\x6f\156" => "\150\x74\x74\160\x3a\x2f\x2f\x65\170\141\155\x70\x6c\145\56\143\x6f\x6d\x2f\x62\x61\162")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("\x47\105\124", "\x68\x74\164\x70\72\x2f\57\145\170\141\x6d\160\x6c\145\x2e\143\x6f\155\77\x61\x3d\x62"); $promise = $handler($request, array("\x61\154\x6c\157\167\137\x72\x65\x64\151\162\x65\143\164\x73" => array("\164\162\x61\143\153\x5f\x72\x65\x64\x69\x72\145\143\164\x73" => true))); $response = $promise->wait(true); self::assertSame(array("\150\x74\164\x70\72\57\x2f\x65\170\141\x6d\160\154\x65\56\143\157\x6d", "\x68\x74\x74\160\x3a\57\57\x65\170\141\x6d\160\154\145\x2e\x63\x6f\155\57\146\x6f\157", "\x68\164\164\x70\72\57\57\x65\170\141\x6d\160\x6c\145\56\x63\x6f\x6d\x2f\142\141\x72"), $response->getHeader(RedirectMiddleware::HISTORY_HEADER)); } public function testAddsGuzzleRedirectStatusHeader() { $mock = new MockHandler(array(new Response(301, array("\114\157\143\x61\164\x69\x6f\156" => "\x68\164\x74\160\x3a\57\57\145\x78\x61\155\x70\154\145\56\x63\157\x6d")), new Response(302, array("\114\x6f\143\141\x74\151\x6f\x6e" => "\x68\x74\164\160\72\57\57\145\x78\x61\155\160\x6c\145\x2e\x63\x6f\x6d\57\146\x6f\x6f")), new Response(301, array("\x4c\157\x63\x61\x74\x69\157\156" => "\150\164\164\160\72\x2f\x2f\145\x78\x61\x6d\160\x6c\145\56\x63\x6f\155\x2f\x62\141\162")), new Response(302, array("\x4c\157\x63\x61\164\x69\157\x6e" => "\x68\164\x74\160\x3a\57\x2f\x65\170\x61\x6d\160\x6c\x65\x2e\x63\157\155\x2f\142\141\x7a")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("\x47\105\x54", "\x68\164\x74\x70\x3a\x2f\57\145\x78\x61\155\x70\154\x65\x2e\143\157\x6d\77\141\75\142"); $promise = $handler($request, array("\x61\154\154\157\x77\x5f\162\x65\x64\151\162\x65\x63\x74\x73" => array("\x74\162\141\143\x6b\137\x72\145\x64\151\162\145\143\x74\x73" => true))); $response = $promise->wait(true); self::assertSame(array("\x33\x30\61", "\63\60\x32", "\63\60\x31", "\63\x30\x32"), $response->getHeader(RedirectMiddleware::STATUS_HISTORY_HEADER)); } public function testDoesNotAddRefererWhenGoingFromHttpsToHttp() { $mock = new MockHandler(array(new Response(302, array("\x4c\157\143\x61\164\x69\x6f\x6e" => "\x68\x74\164\x70\x3a\x2f\x2f\x74\x65\x73\164\56\143\157\x6d")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("\x47\x45\x54", "\150\x74\164\x70\163\x3a\57\57\x65\170\141\155\x70\154\x65\x2e\x63\x6f\x6d\77\141\75\142"); $promise = $handler($request, array("\x61\x6c\154\157\167\137\x72\x65\144\x69\x72\145\x63\164\163" => array("\x6d\x61\170" => 2, "\x72\x65\146\x65\162\145\162" => true))); $promise->wait(); self::assertFalse($mock->getLastRequest()->hasHeader("\x52\145\x66\145\162\x65\162")); } public function testInvokesOnRedirectForRedirects() { $mock = new MockHandler(array(new Response(302, array("\114\x6f\x63\141\x74\x69\157\156" => "\x68\164\x74\x70\72\57\x2f\164\x65\163\x74\56\143\x6f\x6d")), new Response(200))); $stack = new HandlerStack($mock); $stack->push(Middleware::redirect()); $handler = $stack->resolve(); $request = new Request("\x47\105\124", "\150\164\164\160\72\x2f\x2f\x65\x78\x61\155\x70\154\145\x2e\x63\x6f\155\x3f\141\x3d\x62"); $call = false; $promise = $handler($request, array("\x61\154\154\x6f\x77\x5f\x72\x65\x64\151\162\145\143\x74\163" => array("\155\x61\x78" => 2, "\157\x6e\137\x72\x65\144\151\162\145\143\164" => static function ($request, $response, $uri) use(&$call) { self::assertSame(302, $response->getStatusCode()); self::assertSame("\107\x45\x54", $request->getMethod()); self::assertSame("\x68\164\164\x70\72\x2f\57\164\145\x73\x74\56\x63\157\155", (string) $uri); $call = true; }))); $promise->wait(); self::assertTrue($call); } public function testRemoveCurlAuthorizationOptionsOnRedirectCrossHost($auth) { if (!defined("\x5c\103\125\122\114\x4f\x50\x54\137\x48\124\124\x50\101\125\124\x48")) { self::markTestSkipped("\145\170\164\x2d\x63\165\x72\154\40\x69\x73\x20\x72\x65\x71\x75\151\162\145\x64\x20\x66\157\x72\40\x74\x68\x69\163\40\164\x65\163\x74"); } $mock = new MockHandler(array(new Response(302, array("\x4c\157\143\x61\164\151\x6f\156" => "\150\x74\x74\x70\x3a\57\x2f\164\145\163\164\56\143\157\x6d")), static function (RequestInterface $request, $options) { self::assertFalse(isset($options["\143\165\162\154"][\CURLOPT_HTTPAUTH]), "\x63\165\162\x6c\x20\157\x70\x74\x69\x6f\x6e\163\40\163\x74\x69\154\154\x20\143\x6f\156\x74\141\x69\156\40\103\x55\122\x4c\117\x50\124\137\110\x54\x54\120\101\x55\124\110\x20\145\x6e\164\x72\x79"); self::assertFalse(isset($options["\143\x75\162\154"][\CURLOPT_USERPWD]), "\x63\x75\162\154\40\157\x70\x74\x69\157\x6e\x73\x20\x73\164\151\154\x6c\40\143\157\156\164\141\151\x6e\x20\103\125\122\x4c\x4f\x50\124\x5f\125\123\x45\x52\120\x57\104\40\145\x6e\164\162\171"); return new Response(200); })); $handler = HandlerStack::create($mock); $client = new Client(array("\x68\141\156\144\x6c\x65\162" => $handler)); $client->get("\x68\x74\x74\x70\72\57\57\x65\x78\141\x6d\x70\x6c\145\x2e\x63\x6f\x6d\x3f\141\75\x62", array("\x61\165\x74\150" => array("\164\x65\163\x74\x75\163\x65\162", "\164\145\163\164\160\141\163\163", $auth))); } public function testRemoveCurlAuthorizationOptionsOnRedirectCrossPort($auth) { if (!defined("\134\x43\125\x52\x4c\117\120\124\137\x48\x54\124\x50\x41\x55\x54\x48")) { self::markTestSkipped("\145\x78\x74\x2d\143\x75\x72\154\40\151\x73\40\162\x65\161\165\151\162\145\144\x20\146\157\x72\x20\164\x68\151\163\40\x74\x65\x73\164"); } $mock = new MockHandler(array(new Response(302, array("\x4c\x6f\x63\x61\x74\151\x6f\156" => "\150\164\164\x70\72\57\57\145\170\141\x6d\x70\154\145\x2e\x63\x6f\x6d\72\x38\x31\x2f")), static function (RequestInterface $request, $options) { self::assertFalse(isset($options["\143\165\162\154"][\CURLOPT_HTTPAUTH]), "\x63\x75\x72\154\x20\x6f\x70\164\151\x6f\156\x73\x20\163\x74\x69\154\154\40\x63\157\156\164\x61\x69\x6e\40\103\125\x52\x4c\x4f\120\124\x5f\x48\x54\x54\120\101\125\124\110\x20\145\x6e\x74\162\171"); self::assertFalse(isset($options["\143\165\162\154"][\CURLOPT_USERPWD]), "\x63\x75\x72\154\40\157\x70\164\151\157\156\163\x20\x73\164\x69\154\x6c\40\x63\157\x6e\164\141\151\x6e\x20\103\x55\122\x4c\117\120\124\137\x55\123\x45\122\x50\127\104\40\145\x6e\164\x72\x79"); return new Response(200); })); $handler = HandlerStack::create($mock); $client = new Client(array("\150\141\x6e\144\154\x65\162" => $handler)); $client->get("\150\x74\x74\x70\72\x2f\x2f\x65\170\x61\155\160\154\x65\56\143\x6f\x6d\77\141\x3d\x62", array("\x61\x75\164\150" => array("\x74\x65\163\x74\x75\163\145\162", "\x74\x65\x73\164\160\x61\x73\x73", $auth))); } public function testRemoveCurlAuthorizationOptionsOnRedirectCrossScheme($auth) { if (!defined("\134\x43\x55\122\x4c\117\120\x54\137\110\124\124\x50\101\125\x54\x48")) { self::markTestSkipped("\x65\170\x74\x2d\143\x75\x72\x6c\40\x69\x73\x20\162\145\x71\165\x69\162\x65\144\x20\146\x6f\162\40\164\150\x69\x73\x20\164\x65\163\x74"); } $mock = new MockHandler(array(new Response(302, array("\114\157\x63\141\x74\151\x6f\x6e" => "\150\x74\x74\160\72\x2f\57\145\170\141\x6d\160\154\145\56\x63\157\155\x3f\x61\75\142")), static function (RequestInterface $request, $options) { self::assertFalse(isset($options["\143\x75\x72\154"][\CURLOPT_HTTPAUTH]), "\143\165\162\x6c\x20\157\160\164\x69\x6f\x6e\163\x20\163\164\151\x6c\154\x20\x63\157\x6e\164\x61\151\x6e\x20\103\x55\x52\114\117\120\124\x5f\x48\x54\x54\x50\x41\x55\x54\x48\40\x65\x6e\164\x72\171"); self::assertFalse(isset($options["\x63\165\162\x6c"][\CURLOPT_USERPWD]), "\143\165\x72\154\40\x6f\160\x74\151\x6f\x6e\163\40\x73\x74\x69\154\x6c\x20\x63\157\156\164\141\x69\x6e\40\x43\x55\x52\114\117\x50\x54\137\x55\x53\x45\122\x50\x57\x44\40\145\x6e\x74\162\171"); return new Response(200); })); $handler = HandlerStack::create($mock); $client = new Client(array("\x68\141\156\x64\x6c\145\162" => $handler)); $client->get("\x68\x74\164\160\x73\72\57\57\x65\170\141\155\x70\154\145\x2e\x63\x6f\x6d\77\x61\x3d\x62", array("\x61\x75\164\x68" => array("\164\145\x73\164\165\x73\145\162", "\164\145\163\164\x70\141\x73\163", $auth))); } public function testRemoveCurlAuthorizationOptionsOnRedirectCrossSchemeSamePort($auth) { if (!defined("\x5c\x43\x55\122\x4c\x4f\x50\124\137\x48\x54\124\120\101\125\124\110")) { self::markTestSkipped("\145\x78\164\55\x63\165\x72\x6c\40\x69\163\x20\162\145\161\165\x69\162\145\144\x20\x66\157\162\40\x74\x68\151\x73\x20\x74\145\x73\x74"); } $mock = new MockHandler(array(new Response(302, array("\x4c\157\x63\141\164\x69\157\x6e" => "\x68\164\164\x70\x3a\57\x2f\145\x78\141\x6d\x70\x6c\x65\x2e\143\157\x6d\x3a\x38\60\77\141\75\142")), static function (RequestInterface $request, $options) { self::assertFalse(isset($options["\143\165\x72\x6c"][\CURLOPT_HTTPAUTH]), "\x63\x75\162\x6c\40\157\x70\x74\151\x6f\156\163\40\x73\x74\151\x6c\x6c\x20\143\157\x6e\164\x61\151\x6e\40\103\125\x52\x4c\117\x50\124\137\x48\124\x54\120\101\x55\124\110\x20\x65\x6e\x74\162\x79"); self::assertFalse(isset($options["\143\165\162\x6c"][\CURLOPT_USERPWD]), "\x63\165\x72\154\x20\x6f\160\x74\x69\157\156\x73\40\x73\x74\x69\x6c\154\x20\143\157\x6e\x74\x61\151\x6e\x20\103\125\x52\x4c\117\120\124\x5f\x55\x53\105\x52\120\127\104\x20\x65\156\x74\x72\171"); return new Response(200); })); $handler = HandlerStack::create($mock); $client = new Client(array("\x68\x61\x6e\x64\x6c\145\162" => $handler)); $client->get("\x68\164\164\x70\163\x3a\57\57\145\x78\x61\155\x70\x6c\145\56\x63\x6f\x6d\77\x61\x3d\142", array("\x61\x75\x74\150" => array("\x74\145\163\x74\165\163\x65\162", "\164\x65\163\164\160\141\163\x73", $auth))); } public function testNotRemoveCurlAuthorizationOptionsOnRedirect($auth) { if (!defined("\x5c\103\x55\x52\114\117\120\x54\137\110\x54\x54\x50\101\125\x54\110") || !defined("\x5c\x43\x55\x52\x4c\117\120\x54\x5f\x55\123\105\122\120\127\104")) { self::markTestSkipped("\x65\x78\x74\55\x63\165\162\x6c\x20\x69\x73\x20\162\x65\x71\165\x69\x72\x65\x64\40\x66\157\x72\40\164\x68\151\163\x20\x74\x65\163\164"); } $mock = new MockHandler(array(new Response(302, array("\x4c\x6f\143\141\x74\151\x6f\156" => "\x68\x74\x74\160\x3a\57\57\145\x78\141\x6d\160\x6c\145\56\x63\157\x6d\57\62")), static function (RequestInterface $request, $options) { self::assertTrue(isset($options["\143\x75\x72\154"][\CURLOPT_HTTPAUTH]), "\143\x75\162\x6c\40\157\x70\164\x69\x6f\156\163\x20\144\x6f\145\163\40\156\x6f\164\40\143\157\156\x74\141\x69\156\40\145\170\160\x65\x63\164\145\144\x20\103\x55\x52\x4c\117\x50\x54\x5f\110\x54\x54\120\101\x55\x54\x48\40\145\x6e\164\x72\x79"); self::assertTrue(isset($options["\x63\165\162\x6c"][\CURLOPT_USERPWD]), "\x63\165\x72\154\x20\x6f\x70\x74\x69\x6f\x6e\x73\x20\x64\157\x65\163\40\x6e\x6f\x74\40\143\157\156\x74\141\x69\156\x20\x65\x78\x70\x65\x63\x74\145\144\x20\x43\125\122\x4c\x4f\120\124\137\x55\123\105\x52\x50\x57\104\40\x65\x6e\164\162\x79"); return new Response(200); })); $handler = HandlerStack::create($mock); $client = new Client(array("\150\141\156\144\154\x65\x72" => $handler)); $client->get("\x68\x74\164\160\72\57\x2f\x65\170\141\x6d\x70\x6c\x65\56\143\157\155\x3f\141\x3d\x62", array("\141\165\164\150" => array("\164\145\163\x74\165\163\145\x72", "\x74\145\x73\x74\160\x61\x73\163", $auth))); } public function crossOriginRedirectProvider() { return array(array("\150\164\164\x70\x3a\x2f\x2f\x65\170\141\x6d\160\x6c\145\56\143\157\155\x2f\x31\62\63", "\150\x74\164\160\x3a\x2f\57\145\x78\x61\x6d\160\154\x65\56\x63\x6f\155\x2f", false), array("\x68\x74\164\160\x3a\x2f\57\x65\x78\141\x6d\x70\x6c\x65\x2e\x63\157\155\x2f\61\62\63", "\x68\164\x74\160\x3a\57\57\145\x78\x61\x6d\160\154\x65\56\143\157\x6d\x3a\70\x30\57", false), array("\x68\164\x74\160\x3a\57\57\145\x78\x61\x6d\160\x6c\145\56\143\157\155\x3a\70\x30\57\x31\x32\63", "\x68\x74\164\160\72\x2f\x2f\x65\170\141\x6d\160\x6c\x65\x2e\143\157\x6d\x2f", false), array("\x68\x74\164\160\72\x2f\x2f\145\x78\x61\x6d\160\154\145\56\143\157\x6d\x3a\x38\x30\57\x31\62\x33", "\150\164\x74\160\x3a\x2f\57\x65\170\x61\x6d\160\154\145\56\143\x6f\155\x3a\x38\60\57", false), array("\150\164\x74\x70\x3a\57\57\x65\x78\141\x6d\x70\x6c\145\x2e\x63\157\155\x2f\61\x32\63", "\150\x74\164\160\x73\x3a\57\57\x65\170\141\x6d\x70\154\x65\x2e\143\x6f\x6d\x2f", true), array("\150\x74\164\x70\72\x2f\57\145\x78\141\x6d\x70\x6c\x65\56\x63\157\155\57\61\x32\63", "\x68\x74\164\x70\72\57\57\167\x77\x77\56\x65\170\x61\155\x70\x6c\x65\56\143\x6f\155\57", true), array("\150\x74\164\160\x3a\x2f\57\x65\x78\141\155\160\x6c\x65\x2e\143\157\x6d\x2f\61\x32\63", "\x68\x74\164\x70\x3a\57\x2f\x65\x78\x61\155\160\x6c\x65\56\143\x6f\155\x3a\70\61\57", true), array("\x68\x74\164\x70\72\57\57\x65\x78\141\x6d\x70\x6c\x65\56\x63\x6f\155\x3a\70\x30\x2f\61\x32\63", "\150\x74\x74\x70\72\57\57\x65\170\x61\x6d\160\x6c\145\x2e\x63\x6f\x6d\72\70\x31\57", true), array("\x68\x74\x74\160\163\x3a\57\57\145\x78\141\x6d\160\x6c\145\x2e\x63\x6f\155\x2f\61\62\x33", "\150\x74\164\160\x73\x3a\57\x2f\145\170\141\x6d\160\154\x65\x2e\x63\x6f\x6d\57", false), array("\x68\164\164\x70\163\72\57\57\x65\170\x61\x6d\x70\154\x65\x2e\x63\x6f\155\x2f\61\62\63", "\x68\164\x74\160\163\x3a\x2f\x2f\145\x78\141\155\x70\154\x65\x2e\143\157\x6d\x3a\x34\64\63\57", false), array("\150\164\x74\x70\x73\x3a\x2f\57\145\170\141\155\x70\154\x65\x2e\143\x6f\155\x3a\64\64\63\57\61\62\x33", "\150\x74\164\x70\163\x3a\57\x2f\x65\170\141\155\160\154\x65\x2e\x63\x6f\x6d\x2f", false), array("\150\164\164\160\163\72\57\x2f\145\x78\x61\155\x70\154\145\x2e\143\x6f\x6d\x3a\x34\64\63\57\61\x32\x33", "\x68\x74\164\x70\163\72\57\57\x65\170\141\x6d\x70\x6c\x65\56\x63\x6f\x6d\72\x34\64\x33\x2f", false), array("\150\164\164\x70\x73\72\57\x2f\145\170\x61\155\160\154\145\56\143\x6f\155\57\x31\62\63", "\x68\x74\x74\x70\72\57\57\x65\x78\x61\155\x70\x6c\145\x2e\143\157\155\57", true), array("\x68\164\164\x70\163\x3a\57\x2f\145\x78\x61\155\x70\154\145\56\x63\x6f\155\x2f\61\62\x33", "\x68\164\164\x70\163\x3a\x2f\57\167\x77\x77\56\145\170\141\x6d\x70\154\x65\56\143\157\155\57", true), array("\x68\164\164\160\163\x3a\x2f\57\145\x78\x61\x6d\160\x6c\x65\x2e\143\157\155\57\x31\62\63", "\x68\x74\x74\x70\x73\x3a\x2f\x2f\145\x78\x61\x6d\x70\154\145\56\143\x6f\155\72\x34\x34\64\57", true), array("\x68\x74\x74\x70\163\72\57\57\x65\170\141\x6d\x70\154\x65\56\x63\x6f\x6d\x3a\x34\64\63\x2f\61\62\63", "\x68\x74\x74\160\x73\x3a\57\x2f\x65\x78\x61\x6d\x70\x6c\145\x2e\143\157\155\72\64\64\64\x2f", true)); } public function testHeadersTreatmentOnRedirect($originalUri, $targetUri, $isCrossOrigin) { $mock = new MockHandler(array(new Response(302, array("\114\157\143\141\164\151\x6f\156" => $targetUri)), static function (RequestInterface $request) use($isCrossOrigin) { self::assertSame(!$isCrossOrigin, $request->hasHeader("\x41\x75\x74\x68\x6f\162\x69\172\141\x74\151\157\156")); self::assertSame(!$isCrossOrigin, $request->hasHeader("\103\x6f\157\153\x69\145")); return new Response(200); })); $handler = HandlerStack::create($mock); $client = new Client(array("\150\141\x6e\x64\x6c\145\162" => $handler)); $client->get($originalUri, array("\141\x75\164\150" => array("\164\145\163\164\165\x73\x65\162", "\164\145\x73\164\160\141\163\x73"), "\x68\145\x61\x64\145\162\163" => array("\x43\157\x6f\x6b\x69\x65" => "\146\x6f\x6f\x3d\142\141\162"))); } public function testNotRemoveAuthorizationHeaderOnRedirect() { $mock = new MockHandler(array(new Response(302, array("\114\157\143\141\x74\151\x6f\156" => "\150\164\x74\x70\72\57\57\x65\170\141\x6d\160\x6c\x65\x2e\143\157\155\x2f\62")), static function (RequestInterface $request) { self::assertTrue($request->hasHeader("\101\165\x74\x68\157\x72\x69\x7a\141\x74\151\157\x6e")); return new Response(200); })); $handler = HandlerStack::create($mock); $client = new Client(array("\x68\141\156\144\154\145\x72" => $handler)); $client->get("\150\164\x74\x70\x3a\x2f\x2f\x65\170\141\155\x70\x6c\145\x2e\143\x6f\155\77\x61\75\x62", array("\141\x75\164\x68" => array("\x74\x65\x73\164\x75\x73\145\x72", "\x74\145\163\x74\x70\141\163\163"))); } public function testModifyRequestFollowRequestMethodAndBody(RequestInterface $request, $expectedFollowRequestMethod) { $redirectMiddleware = new RedirectMiddleware(static function () { }); $options = array("\x61\154\154\157\167\137\162\145\x64\x69\162\x65\143\x74\x73" => array("\160\x72\x6f\164\x6f\143\x6f\x6c\x73" => array("\x68\164\x74\160", "\150\x74\x74\160\x73"), "\x73\164\x72\151\x63\164" => false, "\x72\x65\x66\145\162\x65\162" => null)); $modifiedRequest = $redirectMiddleware->modifyRequest($request, $options, new Response()); self::assertEquals($expectedFollowRequestMethod, $modifiedRequest->getMethod()); self::assertEquals(0, $modifiedRequest->getBody()->getSize()); } public function modifyRequestFollowRequyestMethodAndBodyProvider() { return array("\104\x45\114\x45\124\105" => array("\162\x65\x71\x75\x65\163\x74" => new Request("\x44\x45\x4c\105\124\105", "\150\x74\164\x70\72\x2f\57\x65\x78\141\x6d\x70\154\145\56\x63\x6f\155\x2f"), "\145\x78\x70\x65\x63\x74\x65\144\x46\x6f\154\154\157\167\x52\145\161\x75\x65\x73\x74\x4d\x65\164\x68\x6f\x64" => "\x47\105\x54"), "\107\x45\x54" => array("\x72\x65\161\165\x65\163\164" => new Request("\107\x45\x54", "\x68\164\x74\x70\x3a\x2f\57\145\170\x61\155\160\154\145\56\143\157\155\x2f"), "\x65\x78\x70\x65\x63\x74\145\x64\x46\157\x6c\x6c\157\167\x52\145\161\x75\145\163\164\115\x65\x74\150\x6f\144" => "\x47\105\x54"), "\110\105\x41\x44" => array("\162\x65\161\165\x65\x73\x74" => new Request("\110\105\x41\x44", "\x68\164\x74\160\72\x2f\57\x65\x78\x61\x6d\x70\x6c\x65\56\x63\157\x6d\x2f"), "\x65\170\160\x65\143\164\x65\144\x46\x6f\154\154\157\167\122\145\x71\165\x65\x73\x74\x4d\145\x74\x68\x6f\x64" => "\110\105\101\x44"), "\x4f\x50\x54\x49\117\x4e\x53" => array("\x72\145\x71\165\145\x73\164" => new Request("\x4f\120\x54\111\117\116\x53", "\x68\x74\164\160\x3a\x2f\57\145\170\x61\155\x70\154\145\56\x63\157\155\x2f"), "\145\170\x70\145\143\164\145\x64\x46\x6f\154\154\x6f\x77\122\145\161\165\x65\x73\164\115\x65\x74\x68\157\x64" => "\117\120\x54\111\117\x4e\123"), "\x50\101\124\103\110" => array("\x72\x65\161\x75\145\163\x74" => new Request("\x50\101\x54\x43\110", "\x68\164\164\160\x3a\57\x2f\145\x78\x61\155\x70\154\x65\x2e\x63\x6f\155\x2f"), "\x65\x78\x70\145\x63\x74\145\144\106\157\154\154\157\x77\x52\145\x71\165\x65\x73\164\x4d\145\164\x68\157\x64" => "\107\x45\x54"), "\x50\x4f\123\x54" => array("\x72\145\x71\165\x65\163\x74" => new Request("\120\x4f\x53\124", "\x68\164\164\x70\x3a\x2f\57\x65\x78\x61\x6d\160\154\145\56\143\x6f\x6d\57"), "\145\x78\x70\145\x63\164\x65\144\106\157\154\154\157\x77\122\x65\161\165\x65\x73\x74\x4d\x65\164\x68\x6f\x64" => "\107\105\x54"), "\120\x55\x54" => array("\162\x65\x71\x75\145\163\x74" => new Request("\120\125\124", "\150\x74\x74\x70\72\x2f\x2f\145\x78\141\x6d\160\154\145\x2e\143\157\155\57"), "\x65\170\160\x65\143\164\x65\144\x46\x6f\154\154\x6f\167\x52\x65\x71\x75\x65\163\x74\x4d\x65\x74\x68\x6f\144" => "\x47\x45\124")); } }

Function Calls

None

Variables

None

Stats

MD5 e42ad04a08b662a97e5e9caa6ba7a640
Eval Count 0
Decode Time 133 ms