Benign go Download

github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.898

Contains an unbounded block loopGo loop omits its continuation condition

Evidence

Calls Go t.Error or t.Errorf circuit_breaker_test.go · lines 1–48
1package common
2
3import "testing"
4
5func Test_checkDomain(t *testing.T) {
6 type args struct {
7 endpoint string
⋯9 lines
17 {"invalid endpoint", args{endpoint: "cvm.com"}, false},
18 }
19 for _, tt := range tests {
20 t.Run(tt.name, func(t *testing.T) {
21 if got := checkEndpoint(tt.args.endpoint); got != tt.want {
22 t.Errorf("checkEndpoint() = %v, want %v", got, tt.want)
23 }
24 })
⋯24 lines
imports encoding/hex client.go · lines 1–32
1package common
2
3import (
4 "encoding/hex"
5 "fmt"
6 "log"
7 "net/http"
8 "net/http/httputil"
9 "net/url"
10 "os"
11 "reflect"
12 "regexp"
13 "strconv"
14 "strings"
15 "time"
16
17 tcerr "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
18 tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http"
19 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/json"
20 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
21)
22
23const (
24 octetStream = "application/octet-stream"
25)
26
⋯6 lines
HMAC-SHA256 API name reference client.go · lines 123–131
123:56… st, response tchttp.Response) (err error) {
124 if c.signMethod == "HmacSHA1" || c.signMethod == "HmacSHA256" {
125 return c.sendWithSignatureV1(request, response)
126 } else {
⋯5 lines
Tencent Cloud action request header client.go · lines 132–138
132:16… [string]string{
133 "Host": request.GetDomain(),
134 "X-TC-Action": request.GetAction(),
135 "X-TC-Version": request.GetVersion(),
136 "X-TC-Timestamp": request.GetParams()["Timestamp"],
137 "X-TC-RequestClient": request.GetParams()["RequestClient"],
138 "X-TC-Language": c …
Go declares a byte-slice variable client.go · lines 144–159
144:44… Token() != "" {
145 headers["X-TC-Token"] = c.credential.GetToken()
146 }
147 if request.GetHttpMethod() == "GET" {
148 headers["Content-Type"] = "application/x-www-form-urlencoded"
149 } else {
150 headers["Content-Type"] = "application/json"
151 }
152 isOctetStream := false
153 cr := &tchttp.CommonRequest{}
154 ok := false
155 var octetStreamBody []byte
156 if cr, ok = request.(*tchttp.CommonRequest); ok {
157 if cr.IsOctetStream() {
158 isOctetStream = true
159 // custom headers must …

Showing the top 5 files — 5 more files (31 regions) not shown.

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.