Add headers to notification request of vnflcm
[vfc/gvnfm/vnflcm.git] / lcm / lcm / pub / utils / notificationsutil.py
index 8a38fd6..fe0b640 100644 (file)
@@ -61,7 +61,7 @@ class NotificationsUtil(object):
             }
             callbackUri = subscription.callback_uri
             auth_info = json.loads(subscription.auth_info)
-            if auth_info["authType"] != const.OAUTH2_CLIENT_CREDENTIALS:
+            if const.BASIC in auth_info["authType"]:
                 try:
                     self.post_notification(callbackUri, auth_info, notification)
                 except Exception as e:
@@ -75,6 +75,7 @@ class NotificationsUtil(object):
         resp = requests.post(
             callbackUri,
             data=notification,
+            headers={'content-type': 'application/json'},
             auth=HTTPBasicAuth(username, password)
         )
         if resp.status_code != status.HTTP_204_NO_CONTENT: