You are here

protected function DebugCallGraphTrait::debugInfoForRequest in Varnish purger 8.2

Extract debug information from a request.

Parameters

\Psr\Http\Message\RequestInterface $r: The HTTP request object.

Return value

string[]

1 call to DebugCallGraphTrait::debugInfoForRequest()
DebugCallGraphTrait::logFailedRequest in src/DebugCallGraphTrait.php
Write an error to the log for a failed request.

File

src/DebugCallGraphTrait.php, line 83

Class

DebugCallGraphTrait

Namespace

Drupal\varnish_purger

Code

protected function debugInfoForRequest(RequestInterface $r) {
  $info = [];
  $info['req http'] = $r
    ->getProtocolVersion();
  $info['req uri'] = $r
    ->getUri()
    ->__toString();
  $info['req method'] = $r
    ->getMethod();
  $info['req headers'] = [];
  foreach ($r
    ->getHeaders() as $h => $v) {
    $info['req headers'][] = $h . ': ' . $r
      ->getHeaderLine($h);
  }
  return $info;
}