Remove cache control from meta data endpoint (#237)
* Remove cache control from meta data endpoint * Run prettier * Added a comment
This commit is contained in:
Родитель
c4879740fb
Коммит
41e8fc6296
|
@ -39,7 +39,19 @@ export class CloudSettings {
|
|||
}
|
||||
|
||||
try {
|
||||
const response = await axios.get<{ AzureAD: CloudInfo | undefined }>(kustoUri + this.METADATA_ENDPOINT);
|
||||
const response = await axios.get<{ AzureAD: CloudInfo | undefined }>(kustoUri + this.METADATA_ENDPOINT, {
|
||||
headers: {
|
||||
"Cache-Control": "no-cache",
|
||||
// Disable caching - it's being cached in memory (Service returns max-age).
|
||||
// The original motivation for this is due to a CORS issue in Ibiza due to a dynamic subdomain.
|
||||
// The first dynamic subdomain is attached to the cache and for some reason isn't invalidated
|
||||
// when there is a new subdomain. It causes the request failure due to CORS.
|
||||
// Example:
|
||||
// Access to XMLHttpRequest at 'https://safrankecc.canadacentral.kusto.windows.net/v1/rest/auth/metadata' from origin
|
||||
// 'https://sandbox-46-11.reactblade.portal.azure.net' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value
|
||||
// 'https://sandbox-46-10.reactblade.portal.azure.net' that is not equal to the supplied origin.
|
||||
},
|
||||
});
|
||||
if (response.status === 200) {
|
||||
this.cloudCache[kustoUri] = response.data.AzureAD || this.defaultCloudInfo;
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче