Skip to content

Commit

Permalink
Merge pull request #817 from inplayer-org/plans-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mirovladimitrovski authored Jun 20, 2024
2 parents 9f59875 + 05b91a1 commit 88e7a8a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

# [3.13.28] - 20-06-2024

### Fixes

- Send authorization header for `getSignedMediaToken` conditionally

# [3.13.27] - 19-06-2024

### Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@inplayer-org/inplayer.js",
"version": "3.13.27",
"version": "3.13.28",
"author": "InPlayer",
"license": "MIT",
"description": "A Javascript SDK for Inplayer's RESTful API",
Expand Down
16 changes: 7 additions & 9 deletions src/endpoints/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
GetAssetsInPackage,
GetItemAccessV1,
GetMerchantPackage,
ItemDetailsV1,
RequestDataCaptureAccessData,
SignedMediaResponse,
SiteEntitlementsResponse
Expand Down Expand Up @@ -849,23 +848,22 @@ class Asset extends BaseExtend {
mediaId: string
): Promise<AxiosResponse<SignedMediaResponse>> {
const tokenObject = await this.request.getToken();
const headers: Record<string, string> = {};

if (tokenObject.token) {
headers.Authorization = `Bearer ${tokenObject.token}`;
}

return this.request.get(API.getSignedMediaToken(appConfigId, mediaId), {
headers: {
Authorization: `Bearer ${tokenObject.token}`
}
headers
});
}

async getSiteEntitlements(
siteId: string
): Promise<AxiosResponse<SiteEntitlementsResponse>> {
const tokenObject = await this.request.getToken();

const headers: Record<string, string> = {
Accept: 'application/json',
'Content-Type': 'application/json'
};
const headers: Record<string, string> = {};

if (tokenObject.token) {
headers.Authorization = `Bearer ${tokenObject.token}`;
Expand Down

0 comments on commit 88e7a8a

Please sign in to comment.