You are here

public function AkamaiClientBase::normalizeUrl in Akamai 8.3

Given a URL, make sure it is fully qualified.

Parameters

string $url: A URL or Drupal path.

Return value

string A fully qualified URL.

1 call to AkamaiClientBase::normalizeUrl()
AkamaiClientBase::normalizeUrls in src/AkamaiClientBase.php
Given a list of URLs, ensure they are fully qualified.

File

src/AkamaiClientBase.php, line 329

Class

AkamaiClientBase
Connects to the Akamai EdgeGrid.

Namespace

Drupal\akamai

Code

public function normalizeUrl($url) {
  if (UrlHelper::isExternal($url)) {
    return $url;
  }
  else {

    // Otherwise, try prepending the base URL.
    $url = ltrim($url, '/');
    $domain = rtrim($this->baseUrl, '/');
    return $domain . '/' . $url;
  }
}