Skip to content

Commit d875839

Browse files
committed
TUN-8487: Add user-agent for quick-tunnel requests
1 parent 1f38dec commit d875839

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cmd/cloudflared/tunnel/quick_tunnel.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ func RunQuickTunnel(sc *subcommandContext) error {
3535
Timeout: httpTimeout,
3636
}
3737

38-
resp, err := client.Post(fmt.Sprintf("%s/tunnel", sc.c.String("quick-service")), "application/json", nil)
38+
req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/tunnel", sc.c.String("quick-service")), nil)
39+
if err != nil {
40+
return errors.Wrap(err, "failed to build quick tunnel request")
41+
}
42+
req.Header.Add("Content-Type", "application/json")
43+
req.Header.Add("User-Agent", buildInfo.UserAgent())
44+
resp, err := client.Do(req)
3945
if err != nil {
4046
return errors.Wrap(err, "failed to request quick Tunnel")
4147
}

0 commit comments

Comments
 (0)