Skip to content

Commit

Permalink
comments address
Browse files Browse the repository at this point in the history
  • Loading branch information
tanyasethi-msft committed Jan 22, 2024
1 parent 6247571 commit 7975f9a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions sdk/storage/azblob/service/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,9 @@ type userAgentTest struct{}
func (u userAgentTest) Do(req *policy.Request) (*http.Response, error) {
const userAgentHeader = "User-Agent"

currentUserAgentHeader := map[string][]string(req.Raw().Header)[userAgentHeader]
if !strings.HasPrefix(currentUserAgentHeader[0], "azsdk-go-azblob/"+exported.ModuleVersion) {
return nil, fmt.Errorf(currentUserAgentHeader[0] + " user agent doesn't match expected agent: azsdk-go-azdatalake/v1.2.0 (go1.19.3; Windows_NT)")
currentUserAgentHeader := req.Raw().Header.Get(userAgentHeader)
if !strings.HasPrefix(currentUserAgentHeader, "azsdk-go-azblob/"+exported.ModuleVersion) {
return nil, fmt.Errorf(currentUserAgentHeader + " user agent doesn't match expected agent: azsdk-go-azdatalake/v1.2.0 (go1.19.3; Windows_NT)")
}

return &http.Response{
Expand Down
6 changes: 3 additions & 3 deletions sdk/storage/azdatalake/file/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ type userAgentTest struct{}
func (u userAgentTest) Do(req *policy.Request) (*http.Response, error) {
const userAgentHeader = "User-Agent"

currentUserAgentHeader := map[string][]string(req.Raw().Header)[userAgentHeader]
if !strings.HasPrefix(currentUserAgentHeader[0], "azsdk-go-azdatalake/"+exported.ModuleVersion) {
return nil, fmt.Errorf(currentUserAgentHeader[0] + " user agent doesn't match expected agent: azsdk-go-azdatalake/vx.xx.xx")
currentUserAgentHeader := req.Raw().Header.Get(userAgentHeader)
if !strings.HasPrefix(currentUserAgentHeader, "azsdk-go-azdatalake/"+exported.ModuleVersion) {
return nil, fmt.Errorf(currentUserAgentHeader + " user agent doesn't match expected agent: azsdk-go-azdatalake/vx.xx.xx")
}

return &http.Response{
Expand Down
8 changes: 4 additions & 4 deletions sdk/storage/azfile/service/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ type userAgentTest struct{}
func (u userAgentTest) Do(req *policy.Request) (*http.Response, error) {
const userAgentHeader = "User-Agent"

currentUserAgentHeader := map[string][]string(req.Raw().Header)[userAgentHeader]
if !strings.HasPrefix(currentUserAgentHeader[0], "azsdk-go-azfile/"+exported.ModuleVersion) {
return nil, fmt.Errorf(currentUserAgentHeader[0] + " user agent doesn't match expected agent: azsdk-go-azfile/vx.xx.x")
currentUserAgentHeader := req.Raw().Header.Get(userAgentHeader)
if !strings.HasPrefix(currentUserAgentHeader, "azsdk-go-azfile/"+exported.ModuleVersion) {
return nil, fmt.Errorf(currentUserAgentHeader + " user agent doesn't match expected agent: azsdk-go-azfile/vx.xx.x")
}

return &http.Response{
Expand All @@ -208,7 +208,7 @@ func newTelemetryTestPolicy() policy.Policy {
return &userAgentTest{}
}

func TestUserAgentAzFile(t *testing.T) {
func TestUserAgentForAzFile(t *testing.T) {
client, err := service.NewClientWithNoCredential("https://fake/blob/testpath", &service.ClientOptions{
ClientOptions: policy.ClientOptions{
PerCallPolicies: []policy.Policy{newTelemetryTestPolicy()},
Expand Down

0 comments on commit 7975f9a

Please sign in to comment.