diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py index 62604e4e3bf4b3723ab0917332f0236ee7a4ace0..09ad7f7e8822da44e627ac22d59b1cd20dd05c58 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py @@ -14,6 +14,7 @@ from .responses import internal_server_error, not_found_error, make_response, ba from ..db.db import MongoDatabse from ..util import serialize_clean_camel_case, clean_empty, dict_to_camel_case from .auth_manager import AuthManager +import os class EventSubscriptionsOperations(Resource): @@ -75,8 +76,7 @@ class EventSubscriptionsOperations(Resource): self.auth_manager.add_auth_event(subscription_id, subscriber_id) res = make_response(object=serialize_clean_camel_case(event_subscription), status=201) - res.headers['Location'] = "http://localhost:8080/capif-events/v1/" + \ - str(subscriber_id) + "/subscriptions/" + str(subscription_id) + res.headers['Location'] = f"http://{os.getenv("CAPIF_HOSTNAME")}/capif-events/v1/{str(subscriber_id)}/subscriptions/{str(subscription_id)}" return res diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py index c1c7db19717d20ef4bce042a17268854e1474ea3..2c2528815c5834a81ab03491049b0557846ac225 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py @@ -40,7 +40,7 @@ class Notifications(): if not (key == "serviceAPIDescriptions" and redis_event.get('event', None) in ["SERVICE_API_AVAILABLE", "SERVICE_API_UNAVAILABLE"]): event_detail[key]=redis_event.get('information', None)[pos] else: - if not (redis_event.get('event', None) in ["SERVICE_API_AVAILABLE", "SERVICE_API_UNAVAILABLE"] and key == "serviceAPIDescriptions" and not EventSubscription.return_supp_feat_dict(sub["supported_features"])["ApiStatusMonitoring"]): + if not (redis_event.get('event', None) in ["SERVICE_API_AVAILABLE", "SERVICE_API_UNAVAILABLE"] and key == "serviceAPIDescriptions" and (not EventSubscription.return_supp_feat_dict(sub["supported_features"])["ApiStatusMonitoring"] or not EventSubscription.return_supp_feat_dict(sub["supported_features"])["EnhancedEventReport"])): event_detail[key]=redis_event.get('information', None)[pos] current_app.logger.debug(event_detail)