code: protected function getRequestHeaders(Message $message, Endpoint $endpoint)
      {
          // Use message headers as default
          $headers = $message->headers;
  
          // Set headers from $endpoint
          if ($endpoint->user !== null) {
              $headers['Authorization'] = 'Basic ' . base64_encode("{$endpoint->user}:{$endpoint->pass}");
          }
  
          // Render headers
          $requestHeaders = '';
  
          foreach ($headers as $name => $value) {
              if (is_numeric($name)) {
                  throw new \RuntimeException("Invalid HTTP header name $name");
              }
  
              $requestHeaders .= "$name: $value\r\n";
          }
  
          return $requestHeaders;
      }
docs: Get formatted request headers.
  
  Merged with the default values.
  
  @param \EzSystems\EzPlatformSolrSearchEngine\Gateway\Message $message
  @param \EzSystems\EzPlatformSolrSearchEngine\Gateway\Endpoint $endpoint
  
  @return string