From 46c81fb501e1740844ae14f08f4f59642ec62b21 Mon Sep 17 00:00:00 2001 From: Moshe Maor Date: Mon, 22 Jul 2024 13:46:06 +0300 Subject: [PATCH] fix(FEC-14049): Send referrer only if it came from iFrame embed (#242) ### Description of the Changes In case of iframe embed, the BE adds a parameter to the bundle window.originalRequestReferrer, this value will be added to api calls from the player to the backend for evaluation of access control request. If the PR is related to an open issue please link to it. Issue: The decision when to send it with API calls to the backend needs to be based if it was supplied in origin Fix: Send the referrer to the provider only if it was supplied by the backend Resolves FEC-[https://kaltura.atlassian.net/browse/[FEC-14049](https://kaltura.atlassian.net/browse/FEC-14049)] --- src/k-provider/ovp/services/base-entry-service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/k-provider/ovp/services/base-entry-service.ts b/src/k-provider/ovp/services/base-entry-service.ts index 97c9674c..80000f76 100644 --- a/src/k-provider/ovp/services/base-entry-service.ts +++ b/src/k-provider/ovp/services/base-entry-service.ts @@ -23,7 +23,10 @@ export default class OVPBaseEntryService extends OVPService { request.method = 'POST'; request.url = request.getUrl(serviceUrl); request.tag = 'baseEntry-getPlaybackContext'; - const contextDataParams = {objectType: 'KalturaContextDataParams', flavorTags: 'all', referrer}; + const contextDataParams = {objectType: 'KalturaContextDataParams', flavorTags: 'all'}; + if (referrer) { + contextDataParams['referrer'] = referrer; + } request.params = {entryId: serviceEntryId, ks: ks, contextDataParams: contextDataParams}; return request; }