Index: content_retriever.module
===================================================================
--- content_retriever.module	(revision 5740)
+++ content_retriever.module	(working copy)
@@ -580,17 +580,25 @@
  * @return
  *  An array of parameters. If no key is being used, this will be empty.
  */
-function _content_retriever_xmlrpc_key_args($method) {
+function _content_retriever_xmlrpc_key_args($method) {
   $api_key  = variable_get('content_retriever_api_key', '');
-
+
   // Build the API key arguments - if no key supplied supplied, presume not required
   if ($api_key != '') {
     //use api key to get a hash code for the service.
     $timestamp = (string) strtotime("now");
-    $domain = $_SERVER['SERVER_NAME'];
-    if ($_SERVER['SERVER_PORT'] != 80) {
-      $domain .= ':' . $_SERVER['SERVER_PORT'];
+    if (isset($_SERVER['SERVER_NAME'])) {
+      $domain = $_SERVER['SERVER_NAME'];
+      if ($_SERVER['SERVER_PORT'] != 80) {
+        $domain .= ':' . $_SERVER['SERVER_PORT'];
+      }
     }
+    elseif (isset($_SERVER['HTTP_HOST'])) {
+      $domain = $_SERVER['HTTP_HOST'];
+    }
+    else {
+      trigger_error('Can not determine domain name from server environment variables. Content retriever may not function.', E_USER_WARNING);
+    }
     $nonce = content_retriever_get_unique_code('10');
     $hash_parameters = array(
       $timestamp,

