mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 11:48:04 +00:00
Added greater granularity for boolean environment variables (#511)
* Added greater granularity for boolean environment variables * Improved solution as reviewed
This commit is contained in:
@@ -4,12 +4,12 @@ import (
|
||||
"context"
|
||||
"html"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/komodorio/helm-dashboard/pkg/dashboard/handlers"
|
||||
"github.com/komodorio/helm-dashboard/pkg/dashboard/objects"
|
||||
"github.com/komodorio/helm-dashboard/pkg/dashboard/utils"
|
||||
"github.com/komodorio/helm-dashboard/pkg/frontend"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -95,7 +95,7 @@ func NewRouter(abortWeb context.CancelFunc, data *objects.DataLayer, debug bool)
|
||||
api.Use(errorHandler)
|
||||
api.Use(corsMiddleware())
|
||||
|
||||
if os.Getenv("HD_CORS") != "" {
|
||||
if utils.EnvAsBool("HD_CORS", false) {
|
||||
api.Use(allowCORS)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user