Skip to content

Commit

Permalink
stop using hardcoded the agent install path
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulkaukuntla committed Mar 7, 2025
1 parent e063c05 commit 1fe22ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions comp/core/gui/guiimpl/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
"github.com/DataDog/datadog-agent/comp/core/status"

"github.com/DataDog/datadog-agent/pkg/api/security"
"github.com/DataDog/datadog-agent/pkg/config/setup"
"github.com/DataDog/datadog-agent/pkg/util/defaultpaths"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
"github.com/DataDog/datadog-agent/pkg/util/option"
"github.com/DataDog/datadog-agent/pkg/util/system"
Expand Down Expand Up @@ -233,7 +233,7 @@ func renderIndexPage(w http.ResponseWriter, _ *http.Request) {
}

func serveAssets(w http.ResponseWriter, req *http.Request) {
staticFilePath := path.Join(setup.InstallPath, "bin", "agent", "dist", "views")
staticFilePath := path.Join(defaultpaths.GetDistPath(), "views")

// checking against path traversal
path, err := securejoin.SecureJoin(staticFilePath, req.URL.Path)
Expand Down

0 comments on commit 1fe22ae

Please sign in to comment.