Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rest): missing user-agent separator #11473

Merged

Conversation

coryan
Copy link
Contributor

@coryan coryan commented May 2, 2023

This change is Reviewable

@codecov
Copy link

codecov bot commented May 2, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (ea2b632) 93.80% compared to head (49a7682) 93.81%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11473   +/-   ##
=======================================
  Coverage   93.80%   93.81%           
=======================================
  Files        1807     1807           
  Lines      163118   163120    +2     
=======================================
+ Hits       153020   153026    +6     
+ Misses      10098    10094    -4     
Impacted Files Coverage Δ
google/cloud/internal/curl_impl.cc 90.62% <100.00%> (+0.02%) ⬆️
...loud/internal/curl_rest_client_integration_test.cc 98.80% <100.00%> (+<0.01%) ⬆️
...oud/storage/tests/curl_request_integration_test.cc 97.30% <100.00%> (ø)

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@coryan coryan marked this pull request as ready for review May 2, 2023 19:12
@coryan coryan requested a review from a team as a code owner May 2, 2023 19:13
google/cloud/internal/curl_impl.cc Outdated Show resolved Hide resolved
ASSERT_TRUE(payload.contains("headers")) << "payload=" << response->payload;
auto const products = std::vector<std::string>(
absl::StrSplit(payload["headers"].value("User-Agent", ""), ' '));
EXPECT_THAT(products, AllOf(Contains("test-user-agent-prefix-1"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment: I don't know what gives nicer errors between AllOf(Contains(m1), Contains(m2), Contains(m3)) and IsSupersetOf({m1, m2, m3})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not want to fiddle with the type of {"foo", "bar", StartsWith("baz")}, or {Eq("foo"), Eq("bar"), StartsWith("baz")}. I think both are ambiguous (they need to be initializer_list<T> and T can be too many things.

@coryan coryan enabled auto-merge (squash) May 3, 2023 01:40
@coryan coryan merged commit bcdce2f into googleapis:main May 3, 2023
@coryan coryan deleted the fix-rest-missing-user-agent-separator branch May 3, 2023 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants