fix(certificates): handle absolute and relative certificate download urls

This commit is contained in:
Douglas Hall
2019-03-11 15:18:36 -04:00
parent c8d9db2656
commit c74d0816ee

View File

@@ -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;