Display error message on UI download failed due to CORS not set properly #217

This commit is contained in:
Marc Ole Bulling
2024-12-11 11:38:12 +01:00
parent 575d4a6025
commit df952052fb
2 changed files with 8 additions and 2 deletions

View File

@@ -135,7 +135,7 @@ func initCloudConfig(passedFlags flagparser.MainFlags) {
encLevel := configuration.Get().Encryption.Level
env := environment.New()
corsCheckDisabled := passedFlags.DisableCorsCheck || env.DisableCorsCheck
if !corsCheckDisabled && (encLevel == encryption.FullEncryptionStored || encLevel == encryption.FullEncryptionInput) {
if !corsCheckDisabled && (encLevel == encryption.FullEncryptionStored || encLevel == encryption.FullEncryptionInput || encLevel == encryption.EndToEndEncryption) {
ok, err := aws.IsCorsCorrectlySet(cConfig.Aws.Bucket, configuration.Get().ServerUrl)
if err != nil {
fmt.Println("Warning: Cannot check CORS settings. " + err.Error())

View File

@@ -113,7 +113,13 @@
pump();
} catch (err) {
displayError(err);
if (err.message.includes("Failed to fetch")) {
console.log(err);
displayError("Unable to download file. Please contact the uploader. Possible problem: Incorrect CORS rules, if using remote storage");
} else {
displayError(err);
}
}
}