Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions olp-cpp-sdk-authentication/src/AuthenticationClientImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ client::HttpResponse CallApi(const client::OlpClient& client,
}

std::string DeduceContentType(const SignInProperties& properties) {
if (properties.custom_body.has_value()) {
if (properties.custom_body) {
return "";
}
return AuthenticationClientImpl::kApplicationJson;
Expand Down Expand Up @@ -328,7 +328,7 @@ client::CancellationToken AuthenticationClientImpl::SignInClient(
const auto credentials_endpoint = credentials.GetEndpointUrl();
const auto maybe_host_and_rest =
olp::utils::Url::ParseHostAndRest(credentials_endpoint);
if (maybe_host_and_rest.has_value()) {
if (maybe_host_and_rest) {
const auto& host_and_rest = maybe_host_and_rest.value();
olp_client_host = host_and_rest.first;
endpoint = host_and_rest.second;
Expand Down Expand Up @@ -814,7 +814,7 @@ client::CancellationToken AuthenticationClientImpl::GetMyAccount(

client::OlpClient::RequestBodyType AuthenticationClientImpl::GenerateClientBody(
const SignInProperties& properties) {
if (properties.custom_body.has_value()) {
if (properties.custom_body) {
const auto& content = properties.custom_body.value();
return std::make_shared<RequestBodyData>(content.data(),
content.data() + content.size());
Expand Down
6 changes: 3 additions & 3 deletions olp-cpp-sdk-core/tests/utils/UrlTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ using UrlTest = testing::Test;
TEST(UrlTest, ParseHostAndRest) {
{
SCOPED_TRACE("Bad Url");
EXPECT_FALSE(olp::utils::Url::ParseHostAndRest("bad url").has_value());
EXPECT_FALSE(olp::utils::Url::ParseHostAndRest("bad url"));
}

{
SCOPED_TRACE("Good Url");
const auto result = olp::utils::Url::ParseHostAndRest(
"https://account.api.here.com/oauth2/token");
ASSERT_TRUE(result.has_value());
ASSERT_TRUE(result);
const auto& host = result.value().first;
const auto& rest = result.value().second;
EXPECT_EQ(host, "https://account.api.here.com");
Expand All @@ -48,7 +48,7 @@ TEST(UrlTest, ParseHostAndRest) {
SCOPED_TRACE("Good Url with port");
const auto result = olp::utils::Url::ParseHostAndRest(
"https://account.api.here.com:8080/oauth2/token");
ASSERT_TRUE(result.has_value());
ASSERT_TRUE(result);
const auto& host = result.value().first;
const auto& rest = result.value().second;
EXPECT_EQ(host, "https://account.api.here.com:8080");
Expand Down
Loading