You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we have these 2 calls: const endpoint = await getEndpointURL(providerUrl, 'fileinfo') const endpoint = await getEndpointURL(providerURL, 'download')
getEndpointURL() should be case insensitive. "fileinfo" is a special case, since its the only provider route that does not follow camelCase, the express routes are case insensitive by default, so it treats fileinfo equal to fileInfo. The issue is that the service name check (from provider root endpoint) is case sensitive at the moment, so it can easily break...
Solution:
Make this function checks case insensitive
async function getEndpointURL(providerURL, serviceName) {
const response = await fetch(providerURL, {
method: 'GET',
headers: {
'Content-type': 'application/json'
}
})
const providerData = await response.json()
for (const i in providerData.serviceEndpoints) {
if (i === serviceName) {
return providerData.serviceEndpoints[i]
}
}
return null
}
The text was updated successfully, but these errors were encountered:
we have these 2 calls:
const endpoint = await getEndpointURL(providerUrl, 'fileinfo')
const endpoint = await getEndpointURL(providerURL, 'download')
getEndpointURL() should be case insensitive. "fileinfo" is a special case, since its the only provider route that does not follow camelCase, the express routes are case insensitive by default, so it treats
fileinfo
equal tofileInfo
. The issue is that the service name check (from provider root endpoint) is case sensitive at the moment, so it can easily break...Solution:
Make this function checks case insensitive
The text was updated successfully, but these errors were encountered: