public function isValidMD5()
  {
    // Get client secret if available
    $client     = $this->getClient();
    $clientSecret = '';
    if ( ! is_null($client)) {
      $clientSecret = $client->secret;
    }
    unset($client);

    // Get md5 data from header
    $md5 = $this->getRequest()->header('CONTENT_MD5');
    
    // Do validation for JSON data
    if ($this->getRequest()->isJson()) {
      $content = $this->getRequest()->getContent();

      if (empty($md5) and empty($content)) {
        return true;
      }

      return (md5($content.$clientSecret) == $md5);
    }

    // Do validation for others than JSON data
    $input = $this->getRequest()->all();

    if ( ! empty($input)) {
      foreach($input as $key => $item) {
        if (str_contains($key, '/')) {
          unset($input[$key]);
        }
      }
    }

    if (empty($md5) and empty($input)) {
      return true;
    }

    return (md5(http_build_query($input).$clientSecret) == $md5);
  }