Skip to content

Commit c2e89dd

Browse files
committed
add header logs
1 parent d6d5233 commit c2e89dd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

cmd/ctrlc/root/agent/run/run.go

-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ func NewAgentRunCmd() *cobra.Command {
2222
Short: "Run the agent",
2323
Long: `Run the agent to establish connection with the proxy.`,
2424
RunE: func(cmd *cobra.Command, args []string) error {
25-
agentName = strings.Trim(agentName, "\"")
26-
workspace = strings.Trim(workspace, "\"")
27-
2825
proxyAddr := viper.GetString("url")
2926
proxyAddr = strings.TrimPrefix(proxyAddr, "https://")
3027
proxyAddr = strings.TrimPrefix(proxyAddr, "http://")

pkg/agent/agent.go

+9
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ func NewAgent(serverURL, agentName string, opts ...func(*Agent)) *Agent {
6262
for _, opt := range opts {
6363
opt(agent)
6464
}
65+
66+
// Print agent headers for debugging
67+
for key, values := range agent.headers {
68+
if key != "X-Api-Key" {
69+
for _, value := range values {
70+
log.Printf("Header %s: %s", key, value)
71+
}
72+
}
73+
}
6574
return agent
6675
}
6776

0 commit comments

Comments
 (0)