Skip to content

Commit

Permalink
export DefaultLogUserAgent
Browse files Browse the repository at this point in the history
  • Loading branch information
panawala authored and huolang committed May 14, 2022
1 parent cf88b42 commit 26a56d0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const (

var InvalidCompressError = errors.New("Invalid Compress Type")

const defaultLogUserAgent = "golang-sdk-v0.1.0"
const DefaultLogUserAgent = "golang-sdk-v0.1.0"

// Error defines sls error
type Error struct {
Expand Down
2 changes: 1 addition & 1 deletion client_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (c *Client) request(project, method, uri string, headers map[string]string,
if len(c.UserAgent) > 0 {
headers["User-Agent"] = c.UserAgent
} else {
headers["User-Agent"] = defaultLogUserAgent
headers["User-Agent"] = DefaultLogUserAgent
}

c.accessKeyLock.RLock()
Expand Down
2 changes: 1 addition & 1 deletion request.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func realRequest(ctx context.Context, project *LogProject, method, uri string, h
if len(project.UserAgent) > 0 {
headers["User-Agent"] = project.UserAgent
} else {
headers["User-Agent"] = defaultLogUserAgent
headers["User-Agent"] = DefaultLogUserAgent
}

// Access with token
Expand Down

0 comments on commit 26a56d0

Please sign in to comment.