mirror of
https://github.com/Forceu/Gokapi.git
synced 2026-01-08 18:09:42 -06:00
Display error message on UI download failed due to CORS not set properly #217
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user