diff --git a/cmd/ctrlc/root/agent/run/run.go b/cmd/ctrlc/root/agent/run/run.go index c6d1225..0f9f903 100644 --- a/cmd/ctrlc/root/agent/run/run.go +++ b/cmd/ctrlc/root/agent/run/run.go @@ -22,9 +22,6 @@ func NewAgentRunCmd() *cobra.Command { Short: "Run the agent", Long: `Run the agent to establish connection with the proxy.`, RunE: func(cmd *cobra.Command, args []string) error { - agentName = strings.Trim(agentName, "\"") - workspace = strings.Trim(workspace, "\"") - proxyAddr := viper.GetString("url") proxyAddr = strings.TrimPrefix(proxyAddr, "https://") proxyAddr = strings.TrimPrefix(proxyAddr, "http://") diff --git a/pkg/agent/agent.go b/pkg/agent/agent.go index 6361bdf..6e9359d 100644 --- a/pkg/agent/agent.go +++ b/pkg/agent/agent.go @@ -62,6 +62,15 @@ func NewAgent(serverURL, agentName string, opts ...func(*Agent)) *Agent { for _, opt := range opts { opt(agent) } + + // Print agent headers for debugging + for key, values := range agent.headers { + if key != "X-Api-Key" { + for _, value := range values { + log.Printf("Header %s: %s", key, value) + } + } + } return agent }