You are here

public function CdnFarfuturePathProcessor::processInbound in CDN 8.3

Processes the inbound path.

Implementations may make changes to the request object passed in but should avoid all other side effects. This method can be called to process requests other than the current request.

Parameters

string $path: The path to process, with a leading slash.

\Symfony\Component\HttpFoundation\Request $request: The HttpRequest object representing the request to process. Note, if this method is being called via the path_processor_manager service and is not part of routing, the current request object must be cloned before being passed in.

Return value

string The processed path.

Overrides InboundPathProcessorInterface::processInbound

File

src/PathProcessor/CdnFarfuturePathProcessor.php, line 27

Class

CdnFarfuturePathProcessor
Defines a path processor to rewrite CDN farfuture URLs.

Namespace

Drupal\cdn\PathProcessor

Code

public function processInbound($path, Request $request) {

  // @todo Remove before CDN 4.0.
  if (strpos($path, '/cdn/farfuture/') === 0) {
    return $this
      ->processLegacyFarFuture($path, $request);
  }
  if (strpos($path, '/cdn/ff/') === 0) {
    return $this
      ->processFarFuture($path, $request);
  }
  return $path;
}