@@ -103,6 +103,9 @@ public function getContentInfo(LicenseRequest $request, string $access_token, Ht
103103 $ end_point = $ this ->_config ->getEndPoints ()['license_info ' ];
104104 $ request_url = $ end_point . '? ' . http_build_query ($ request );
105105 $ headers = APIUtils::generateCommonAPIHeaders ($ this ->_config , $ access_token );
106+ if (!empty ($ request ->getRequestId ())) {
107+ $ headers ['headers ' ]['x-request-id ' ] = $ request ->getRequestId ();
108+ }
106109 $ raw_response = $ http_client ->doGet ($ request_url , $ headers );
107110 $ license_response = new LicenseResponse (json_decode ($ raw_response , true ));
108111 return $ license_response ;
@@ -126,7 +129,10 @@ public function getContentLicense(LicenseRequest $request, string $access_token,
126129 $ end_point = $ this ->_config ->getEndPoints ()['license ' ];
127130 $ request_url = $ end_point . '? ' . http_build_query ($ request );
128131 $ headers = APIUtils::generateCommonAPIHeaders ($ this ->_config , $ access_token );
129-
132+ if (!empty ($ request ->getRequestId ())) {
133+ $ headers ['headers ' ]['x-request-id ' ] = $ request ->getRequestId ();
134+ }
135+
130136 if ($ request ->getLicenseReference () != null ) {
131137 $ raw_response = $ http_client ->doPost ($ request_url , $ headers , $ request ->getLicenseReference ());
132138 } else {
@@ -156,6 +162,9 @@ public function getMemberProfile(LicenseRequest $request, string $access_token,
156162 $ end_point = $ this ->_config ->getEndPoints ()['user_profile ' ];
157163 $ request_url = $ end_point . '? ' . http_build_query ($ request );
158164 $ headers = APIUtils::generateCommonAPIHeaders ($ this ->_config , $ access_token );
165+ if (!empty ($ request ->getRequestId ())) {
166+ $ headers ['headers ' ]['x-request-id ' ] = $ request ->getRequestId ();
167+ }
159168 $ raw_response = $ http_client ->doGet ($ request_url , $ headers );
160169 $ license_response = new LicenseResponse (json_decode ($ raw_response , true ));
161170 return $ license_response ;
@@ -176,6 +185,9 @@ public function abandonLicense(LicenseRequest $request, string $access_token, Ht
176185 $ end_point = $ this ->_config ->getEndPoints ()['abandon ' ];
177186 $ request_url = $ end_point . '? ' . http_build_query ($ request );
178187 $ headers = APIUtils::generateCommonAPIHeaders ($ this ->_config , $ access_token );
188+ if (!empty ($ request ->getRequestId ())) {
189+ $ headers ['headers ' ]['x-request-id ' ] = $ request ->getRequestId ();
190+ }
179191 $ response = $ http_client ->doGet ($ request_url , $ headers );
180192 $ code = (int ) $ response ->getContents ();
181193
@@ -240,6 +252,9 @@ public function downloadAssetRequest(LicenseRequest $request, string $access_tok
240252
241253 $ url = $ purchase_details ->getUrl ();
242254 $ headers = APIUtils::generateCommonAPIHeaders ($ this ->_config , $ access_token );
255+ if (!empty ($ request ->getRequestId ())) {
256+ $ headers ['headers ' ]['x-request-id ' ] = $ request ->getRequestId ();
257+ }
243258 $ headers ['allow_redirects ' ] = false ;
244259 $ client_handler = $ http_client ->getHandlerStack ();
245260 //adds middleware in the client which controls the redirection behaviour.
0 commit comments