mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 18:59:57 +00:00
TUN-8487: Add user-agent for quick-tunnel requests
This commit is contained in:
@@ -35,7 +35,13 @@ func RunQuickTunnel(sc *subcommandContext) error {
|
|||||||
Timeout: httpTimeout,
|
Timeout: httpTimeout,
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := client.Post(fmt.Sprintf("%s/tunnel", sc.c.String("quick-service")), "application/json", nil)
|
req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/tunnel", sc.c.String("quick-service")), nil)
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrap(err, "failed to build quick tunnel request")
|
||||||
|
}
|
||||||
|
req.Header.Add("Content-Type", "application/json")
|
||||||
|
req.Header.Add("User-Agent", buildInfo.UserAgent())
|
||||||
|
resp, err := client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to request quick Tunnel")
|
return errors.Wrap(err, "failed to request quick Tunnel")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user