Skip to content
Permalink
Browse files

abstract out the request creation method, closes #1

  • Loading branch information
SignpostMarv committed Aug 31, 2019
1 parent eb42abe commit 68c303c3a704a4be60bd94f55388efe0376e997d
Showing with 17 additions and 8 deletions.
  1. +17 −8 src/Esi.php
@@ -23,14 +23,7 @@ class Esi extends Base
*/
public function handle(HttpCache $cache, $uri, $alt, $ignoreErrors)
{
$request = Request::create(
$uri,
Request::METHOD_GET,
[],
$cache->getRequest()->cookies->all(),
[],
$cache->getRequest()->server->all()
);
$request = $this->handleRequestGeneration($cache, $uri);
/**
* @var Response|null
@@ -57,4 +50,20 @@ public function handle(HttpCache $cache, $uri, $alt, $ignoreErrors)
return (string) $response->getContent();
}
protected function handleRequestGeneration(
HttpCache $cache,
string $uri
) : Request {
$request = Request::create(
$uri,
Request::METHOD_GET,
[],
$cache->getRequest()->cookies->all(),
[],
$cache->getRequest()->server->all()
);
return $request;
}
}

0 comments on commit 68c303c

Please sign in to comment.
You can’t perform that action at this time.