fix
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Thu, 11 Jul 2019 15:27:25 +0000 (17:27 +0200)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Thu, 11 Jul 2019 15:27:25 +0000 (17:27 +0200)
src/rest/gnunet-rest-server.c

index 161da157b53ab9f8e72570591e41b42cebd69404..26ac3feabc36496b13aa771623f54572123dabde 100644 (file)
@@ -446,18 +446,21 @@ create_response (void *cls,
       origin = GNUNET_CONTAINER_multihashmap_get (con_handle->data_handle
                                                     ->header_param_map,
                                                   &key);
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Origin: %s\n", origin);
-      //Only echo for browser plugins
-      if ((0 ==
-           strncmp ("moz-extension://", origin, strlen ("moz-extension://"))) ||
-          (0 == strncmp ("chrome-extension://",
-                         origin,
-                         strlen ("chrome-extension://"))))
+      if (NULL != origin)
       {
-        if (NULL != origin)
+        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Origin: %s\n", origin);
+        //Only echo for browser plugins
+        if ((0 == strncmp ("moz-extension://",
+                           origin,
+                           strlen ("moz-extension://"))) ||
+            (0 == strncmp ("chrome-extension://",
+                           origin,
+                           strlen ("chrome-extension://"))))
+        {
           MHD_add_response_header (con_handle->response,
                                    MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN,
                                    origin);
+        }
       }
     }
     if (NULL != allow_credentials)