File tree 3 files changed +14
-10
lines changed
3 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 2
2
3
3
All notable changes to this project will be documented in this file.
4
4
5
+ # [ 3.13.28] - 20-06-2024
6
+
7
+ ### Fixes
8
+
9
+ - Send authorization header for ` getSignedMediaToken ` conditionally
10
+
5
11
# [ 3.13.27] - 19-06-2024
6
12
7
13
### Changes
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @inplayer-org/inplayer.js" ,
3
- "version" : " 3.13.27 " ,
3
+ "version" : " 3.13.28 " ,
4
4
"author" : " InPlayer" ,
5
5
"license" : " MIT" ,
6
6
"description" : " A Javascript SDK for Inplayer's RESTful API" ,
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import {
15
15
GetAssetsInPackage ,
16
16
GetItemAccessV1 ,
17
17
GetMerchantPackage ,
18
- ItemDetailsV1 ,
19
18
RequestDataCaptureAccessData ,
20
19
SignedMediaResponse ,
21
20
SiteEntitlementsResponse
@@ -849,23 +848,22 @@ class Asset extends BaseExtend {
849
848
mediaId : string
850
849
) : Promise < AxiosResponse < SignedMediaResponse > > {
851
850
const tokenObject = await this . request . getToken ( ) ;
851
+ const headers : Record < string , string > = { } ;
852
+
853
+ if ( tokenObject . token ) {
854
+ headers . Authorization = `Bearer ${ tokenObject . token } ` ;
855
+ }
852
856
853
857
return this . request . get ( API . getSignedMediaToken ( appConfigId , mediaId ) , {
854
- headers : {
855
- Authorization : `Bearer ${ tokenObject . token } `
856
- }
858
+ headers
857
859
} ) ;
858
860
}
859
861
860
862
async getSiteEntitlements (
861
863
siteId : string
862
864
) : Promise < AxiosResponse < SiteEntitlementsResponse > > {
863
865
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 > = { } ;
869
867
870
868
if ( tokenObject . token ) {
871
869
headers . Authorization = `Bearer ${ tokenObject . token } ` ;
You can’t perform that action at this time.
0 commit comments