Fix WORM and BROWSER status calculation (#6360)

One typo introduced in a recent commit miscalculates if worm and browser
are enabled or not. A simple test is also added to detect this issue
in the future if it ever happens again.
This commit is contained in:
Anis Elleuch
2018-08-24 22:36:14 +01:00
committed by kannappanr
parent d547873b17
commit 06d2dfa31c
3 changed files with 22 additions and 12 deletions
+4 -4
View File
@@ -128,8 +128,8 @@ func (s *serverConfig) GetStorageClass() (storageClass, storageClass) {
// GetBrowser get current credentials.
func (s *serverConfig) GetBrowser() bool {
if globalIsEnvWORM {
return globalWORMEnabled
if globalIsEnvBrowser {
return globalIsBrowserEnabled
}
if s == nil {
return true
@@ -139,8 +139,8 @@ func (s *serverConfig) GetBrowser() bool {
// GetWorm get current credentials.
func (s *serverConfig) GetWorm() bool {
if globalIsEnvBrowser {
return globalIsBrowserEnabled
if globalIsEnvWORM {
return globalWORMEnabled
}
if s == nil {
return false