You are here

public function GoogleCSEServices::getProtocol in Google Custom Search Engine 8.3

Returns the current protocol.

Return value

string Returns http or https depending on request.

1 call to GoogleCSEServices::getProtocol()
GoogleCSEServices::service in src/GoogleCSEServices.php
Sends query to Google's Custom Search Engine and returns response.

File

src/GoogleCSEServices.php, line 186

Class

GoogleCSEServices
Additional functions as services for Google CSE.

Namespace

Drupal\google_cse

Code

public function getProtocol() {
  $request = \Drupal::request();
  return $request
    ->isSecure() == TRUE ? 'https://' : 'http://';
}