Skip to content

Commit

Permalink
rename getters to drop proxy suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Nov 22, 2024
1 parent 98407f1 commit 06dff6d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions libs/client-sdk/src/data_sources/streaming_data_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ void StreamingDataSource::Start() {
client_builder.custom_ca_file(*ca_file);
}

if (http_config_.Proxy().HttpProxy()) {
client_builder.http_proxy(*http_config_.Proxy().HttpProxy());
if (http_config_.Proxy().Http()) {
client_builder.http_proxy(*http_config_.Proxy().Http());
}

auto weak_self = weak_from_this();
Expand Down
2 changes: 1 addition & 1 deletion libs/client-sdk/tests/client_config_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ TEST(ClientConfigBindings, ProxyOptions) {

auto client_config = reinterpret_cast<client_side::Config*>(config);

ASSERT_EQ(client_config->HttpProperties().Proxy().HttpProxy(),
ASSERT_EQ(client_config->HttpProperties().Proxy().Http(),
"http://proxy.com:8080");

LDClientConfig_Free(config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class ProxyOptions final {
std::optional<std::string> https_proxy);

ProxyOptions() = default;
[[nodiscard]] std::optional<std::string> HttpProxy() const;
[[nodiscard]] std::optional<std::string> HttpsProxy() const;
[[nodiscard]] std::optional<std::string> Http() const;
[[nodiscard]] std::optional<std::string> Https() const;

private:
std::optional<std::string> http_proxy_;
Expand Down
7 changes: 3 additions & 4 deletions libs/common/src/config/http_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ ProxyOptions::ProxyOptions(std::optional<std::string> http_proxy,
: http_proxy_(std::move(http_proxy)),
https_proxy_(std::move(https_proxy)) {}

std::optional<std::string> ProxyOptions::HttpProxy() const {
std::optional<std::string> ProxyOptions::Http() const {
return http_proxy_;
}

std::optional<std::string> ProxyOptions::HttpsProxy() const {
std::optional<std::string> ProxyOptions::Https() const {
return https_proxy_;
}

Expand Down Expand Up @@ -91,8 +91,7 @@ bool operator==(TlsOptions const& lhs, TlsOptions const& rhs) {
}

bool operator==(ProxyOptions const& lhs, ProxyOptions const& rhs) {
return lhs.HttpProxy() == rhs.HttpProxy() &&
lhs.HttpsProxy() == rhs.HttpsProxy();
return lhs.Http() == rhs.Http() && lhs.Https() == rhs.Https();
}

} // namespace launchdarkly::config::shared::built
4 changes: 2 additions & 2 deletions libs/common/src/config/http_properties_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ ProxyBuilder<SDK>::ProxyBuilder() : ProxyBuilder(Defaults<SDK>::NoProxy()) {}

template <typename SDK>
ProxyBuilder<SDK>::ProxyBuilder(built::ProxyOptions const& proxy) {
http_proxy_ = proxy.HttpProxy();
https_proxy_ = proxy.HttpsProxy();
http_proxy_ = proxy.Http();
https_proxy_ = proxy.Https();
}

static std::optional<std::string> StringFromEnv(char const* env) {
Expand Down
4 changes: 2 additions & 2 deletions libs/internal/src/network/http_requester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ HttpRequest::HttpRequest(std::string const& url,
port_ = uri_components->port();
}

if (properties_.Proxy().HttpProxy()) {
auto const http_proxy = properties_.Proxy().HttpProxy().value();
if (properties_.Proxy().Http()) {
auto const http_proxy = properties_.Proxy().Http().value();
auto http_proxy_uri_components = boost::urls::parse_uri(http_proxy);
if (!http_proxy_uri_components) {
valid_ = false;
Expand Down

0 comments on commit 06dff6d

Please sign in to comment.