From 26a56d0725101c3d25e9539200dd2fdb48dd72ba Mon Sep 17 00:00:00 2001 From: panawala Date: Sat, 14 May 2022 11:39:11 +0800 Subject: [PATCH] export DefaultLogUserAgent --- client.go | 2 +- client_request.go | 2 +- request.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 63d6a674..acb90331 100644 --- a/client.go +++ b/client.go @@ -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 { diff --git a/client_request.go b/client_request.go index d2c09e50..c389a18c 100644 --- a/client_request.go +++ b/client_request.go @@ -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() diff --git a/request.go b/request.go index c161b8da..911b76e9 100644 --- a/request.go +++ b/request.go @@ -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