Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deployments/helm/fleet-intelligence-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ env:
HTTPS_PROXY: ""

logLevel: warn
listenAddress: 0.0.0.0:15133
listenAddress: 127.0.0.1:15133
retentionPeriod: 24h
components: all

Expand Down
10 changes: 5 additions & 5 deletions internal/server/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,20 +630,20 @@ func TestInstallMiddlewares(t *testing.T) {
expectedStatus int
}{
{
name: "GET_request_with_CORS",
name: "GET_request_without_CORS",
method: "GET",
checkHeaders: func(t *testing.T, w *httptest.ResponseRecorder) {
assert.Equal(t, "*", w.Header().Get("Access-Control-Allow-Origin"))
assert.Equal(t, "GET, OPTIONS", w.Header().Get("Access-Control-Allow-Methods"))
assert.Equal(t, "Content-Type", w.Header().Get("Access-Control-Allow-Headers"))
assert.Empty(t, w.Header().Get("Access-Control-Allow-Origin"))
assert.Empty(t, w.Header().Get("Access-Control-Allow-Methods"))
assert.Empty(t, w.Header().Get("Access-Control-Allow-Headers"))
},
expectedStatus: http.StatusOK,
},
{
name: "OPTIONS_request",
method: "OPTIONS",
checkHeaders: nil,
expectedStatus: http.StatusNoContent,
expectedStatus: http.StatusNotFound,
},
}

Expand Down
10 changes: 0 additions & 10 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,16 +465,6 @@ func (s *Server) startServer(ctx context.Context, nvmlInstance nvidianvml.Instan
// installMiddlewares installs basic middleware for the router
func (s *Server) installMiddlewares(router *gin.Engine) {
router.Use(gin.Recovery())
router.Use(func(c *gin.Context) {
c.Header("Access-Control-Allow-Origin", "*")
c.Header("Access-Control-Allow-Methods", "GET, OPTIONS")
c.Header("Access-Control-Allow-Headers", "Content-Type")
if c.Request.Method == "OPTIONS" {
c.AbortWithStatus(204)
return
}
c.Next()
})
}

// healthz returns a simple health check handler
Expand Down
Loading