Treat empty response as non-200 for IPv6 query in c2p resolver

PiperOrigin-RevId: 607022595
pull/35800/head
Alexander Polcyn 12 months ago committed by Copybara-Service
parent 527557d03d
commit b2b6af691e
  1. 6
      src/core/resolver/google_c2p/google_c2p_resolver.cc

@ -173,7 +173,11 @@ void GoogleCloud2ProdResolver::StartLocked() {
absl::StatusOr<std::string> result) mutable { absl::StatusOr<std::string> result) mutable {
resolver->work_serializer_->Run( resolver->work_serializer_->Run(
[resolver, result = std::move(result)]() { [resolver, result = std::move(result)]() {
resolver->IPv6QueryDone(result.ok()); // Check that the payload is non-empty in order to work around
// the fact that there are buggy implementations of metadata
// servers in the wild, which can in some cases return 200
// plus an empty result when they should have returned 404.
resolver->IPv6QueryDone(result.ok() && !result->empty());
}, },
DEBUG_LOCATION); DEBUG_LOCATION);
}, },

Loading…
Cancel
Save