/**
  * Retrieve the URI from the request.
  *
  * If the request instance is a Stratigility decorator, pull the URI from
  * the original request; otherwise, pull it directly.
  *
  * @param RequestInterface $request
  * @return \Psr\Http\Message\UriInterface
  */
 private function getUriFromRequest(RequestInterface $request)
 {
     if ($request instanceof Http\Request) {
         $original = $request->getOriginalRequest();
         return $original->getUri();
     }
     return $request->getUri();
 }