Skip to content

Commit 88e7a8a

Browse files
Merge pull request #817 from inplayer-org/plans-methods
2 parents 9f59875 + 05b91a1 commit 88e7a8a

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

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

5+
# [3.13.28] - 20-06-2024
6+
7+
### Fixes
8+
9+
- Send authorization header for `getSignedMediaToken` conditionally
10+
511
# [3.13.27] - 19-06-2024
612

713
### Changes

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@inplayer-org/inplayer.js",
3-
"version": "3.13.27",
3+
"version": "3.13.28",
44
"author": "InPlayer",
55
"license": "MIT",
66
"description": "A Javascript SDK for Inplayer's RESTful API",

src/endpoints/asset.ts

+7-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
GetAssetsInPackage,
1616
GetItemAccessV1,
1717
GetMerchantPackage,
18-
ItemDetailsV1,
1918
RequestDataCaptureAccessData,
2019
SignedMediaResponse,
2120
SiteEntitlementsResponse
@@ -849,23 +848,22 @@ class Asset extends BaseExtend {
849848
mediaId: string
850849
): Promise<AxiosResponse<SignedMediaResponse>> {
851850
const tokenObject = await this.request.getToken();
851+
const headers: Record<string, string> = {};
852+
853+
if (tokenObject.token) {
854+
headers.Authorization = `Bearer ${tokenObject.token}`;
855+
}
852856

853857
return this.request.get(API.getSignedMediaToken(appConfigId, mediaId), {
854-
headers: {
855-
Authorization: `Bearer ${tokenObject.token}`
856-
}
858+
headers
857859
});
858860
}
859861

860862
async getSiteEntitlements(
861863
siteId: string
862864
): Promise<AxiosResponse<SiteEntitlementsResponse>> {
863865
const tokenObject = await this.request.getToken();
864-
865-
const headers: Record<string, string> = {
866-
Accept: 'application/json',
867-
'Content-Type': 'application/json'
868-
};
866+
const headers: Record<string, string> = {};
869867

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

0 commit comments

Comments
 (0)