Implement read support for CDN3

This commit is contained in:
Jamie Kyle 2023-07-26 15:15:05 -07:00 committed by GitHub
parent 8aac997b4f
commit bbd43b6e38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 3 deletions

View file

@ -1203,6 +1203,9 @@ export function initialize({
if (!isString(cdnUrlObject['2'])) {
throw new Error('WebAPI.initialize: Missing CDN 2 configuration');
}
if (!isString(cdnUrlObject['3'])) {
throw new Error('WebAPI.initialize: Missing CDN 3 configuration');
}
if (!isString(certificateAuthority)) {
throw new Error('WebAPI.initialize: Invalid certificateAuthority');
}
@ -2655,7 +2658,7 @@ export function initialize({
const abortController = new AbortController();
const cdnUrl = isNumber(cdnNumber)
? cdnUrlObject[cdnNumber] || cdnUrlObject['0']
? cdnUrlObject[cdnNumber] ?? cdnUrlObject['0']
: cdnUrlObject['0'];
// This is going to the CDN, not the service, so we use _outerAjax
const stream = await _outerAjax(`${cdnUrl}/attachments/${cdnKey}`, {