From c74d0816ee851dd538e23e26ff232ccb4237412b Mon Sep 17 00:00:00 2001 From: Douglas Hall Date: Mon, 11 Mar 2019 15:18:36 -0400 Subject: [PATCH] fix(certificates): handle absolute and relative certificate download urls --- src/services/ProfileApiService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/ProfileApiService.js b/src/services/ProfileApiService.js index 3d7ccb0..75295f0 100644 --- a/src/services/ProfileApiService.js +++ b/src/services/ProfileApiService.js @@ -116,7 +116,7 @@ function transformCertificateData(data) { transformedData.push({ ...camelCaseObject(cert), certificateType: CERTIFICATE_TYPES[cert.certificate_type], - downloadUrl: `${configuration.LMS_BASE_URL}${cert.download_url}`, + downloadUrl: new URL(cert.download_url, configuration.LMS_BASE_URL).toString(), }); }); return transformedData;