Merge pull request #20191 from jtattermusch/g_stands_for_useless

Remove g-stands-for from user agent string
reviewable/pr22715/r1
Muxi Yan 5 years ago committed by GitHub
commit e2f0d03fb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/core/ext/filters/http/client/http_client_filter.cc
  2. 7
      src/objective-c/tests/UnitTests/APIv2Tests.m
  3. 5
      src/objective-c/tests/UnitTests/GRPCClientTests.m

@ -538,9 +538,8 @@ static grpc_core::ManagedMemorySlice user_agent_from_args(
}
}
gpr_asprintf(&tmp, "%sgrpc-c/%s (%s; %s; %s)", is_first ? "" : " ",
grpc_version_string(), GPR_PLATFORM_STRING, transport_name,
grpc_g_stands_for());
gpr_asprintf(&tmp, "%sgrpc-c/%s (%s; %s)", is_first ? "" : " ",
grpc_version_string(), GPR_PLATFORM_STRING, transport_name);
is_first = 0;
gpr_strvec_add(&v, tmp);

@ -235,12 +235,7 @@ static const NSTimeInterval kInvertedTimeout = 2;
expectedUserAgent = [expectedUserAgent stringByAppendingString:@" ("];
expectedUserAgent =
[expectedUserAgent stringByAppendingString:@GPR_PLATFORM_STRING];
expectedUserAgent =
[expectedUserAgent stringByAppendingString:@"; chttp2; "];
expectedUserAgent = [expectedUserAgent
stringByAppendingString:[NSString
stringWithUTF8String:grpc_g_stands_for()]];
expectedUserAgent = [expectedUserAgent stringByAppendingString:@")"];
expectedUserAgent = [expectedUserAgent stringByAppendingString:@"; chttp2)"];
XCTAssertEqualObjects(userAgent, expectedUserAgent);
NSError *error = nil;

@ -307,10 +307,7 @@ static GRPCProtoMethod *kFullDuplexCallMethod;
expectedUserAgent = [expectedUserAgent stringByAppendingString:GRPC_C_VERSION_STRING];
expectedUserAgent = [expectedUserAgent stringByAppendingString:@" ("];
expectedUserAgent = [expectedUserAgent stringByAppendingString:@GPR_PLATFORM_STRING];
expectedUserAgent = [expectedUserAgent stringByAppendingString:@"; chttp2; "];
expectedUserAgent = [expectedUserAgent
stringByAppendingString:[NSString stringWithUTF8String:grpc_g_stands_for()]];
expectedUserAgent = [expectedUserAgent stringByAppendingString:@")"];
expectedUserAgent = [expectedUserAgent stringByAppendingString:@"; chttp2)"];
XCTAssertEqualObjects(userAgent, expectedUserAgent);
// Change in format of user-agent field in a direction that does not match the regex will

Loading…
Cancel
Save