-// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// Create HTTP/1.1 request including our command.
PostHttpRequestJsonPtr request = boost::make_shared<PostHttpRequestJson>
(HttpRequest::Method::HTTP_POST, "/", HttpVersion::HTTP_11(),
- HostHttpHeader(config->getUrl().getHostname()));
+ HostHttpHeader(config->getUrl().getStrippedHostname()));
config->addBasicAuthHttpHeader(request);
request->setBodyAsJson(command);
request->finalize();
// Create HTTP/1.1 request including our command.
PostHttpRequestJsonPtr request = boost::make_shared<PostHttpRequestJson>
(HttpRequest::Method::HTTP_POST, "/", HttpVersion::HTTP_11(),
- HostHttpHeader(partner_config->getUrl().getHostname()));
+ HostHttpHeader(partner_config->getUrl().getStrippedHostname()));
partner_config->addBasicAuthHttpHeader(request);
request->setBodyAsJson(CommandCreator::createHeartbeat(server_type_));
request->finalize();
// Create HTTP/1.1 request including our command.
PostHttpRequestJsonPtr request = boost::make_shared<PostHttpRequestJson>
(HttpRequest::Method::HTTP_POST, "/", HttpVersion::HTTP_11(),
- HostHttpHeader(remote_config->getUrl().getHostname()));
+ HostHttpHeader(remote_config->getUrl().getStrippedHostname()));
remote_config->addBasicAuthHttpHeader(request);
request->setBodyAsJson(CommandCreator::createDHCPDisable(max_period,
// Create HTTP/1.1 request including our command.
PostHttpRequestJsonPtr request = boost::make_shared<PostHttpRequestJson>
(HttpRequest::Method::HTTP_POST, "/", HttpVersion::HTTP_11(),
- HostHttpHeader(remote_config->getUrl().getHostname()));
+ HostHttpHeader(remote_config->getUrl().getStrippedHostname()));
remote_config->addBasicAuthHttpHeader(request);
request->setBodyAsJson(CommandCreator::createDHCPEnable(server_type_));
request->finalize();
// Create HTTP/1.1 request including our command.
PostHttpRequestJsonPtr request = boost::make_shared<PostHttpRequestJson>
(HttpRequest::Method::HTTP_POST, "/", HttpVersion::HTTP_11(),
- HostHttpHeader(partner_config->getUrl().getHostname()));
+ HostHttpHeader(partner_config->getUrl().getStrippedHostname()));
partner_config->addBasicAuthHttpHeader(request);
if (server_type_ == HAServerType::DHCPv4) {
request->setBodyAsJson(CommandCreator::createLease4GetPage(
// Create HTTP/1.1 request including our command.
PostHttpRequestJsonPtr request = boost::make_shared<PostHttpRequestJson>
(HttpRequest::Method::HTTP_POST, "/", HttpVersion::HTTP_11(),
- HostHttpHeader(config->getUrl().getHostname()));
+ HostHttpHeader(config->getUrl().getStrippedHostname()));
config->addBasicAuthHttpHeader(request);
request->setBodyAsJson(command);
request->finalize();
// Create HTTP/1.1 request including our command.
PostHttpRequestJsonPtr request = boost::make_shared<PostHttpRequestJson>
(HttpRequest::Method::HTTP_POST, "/", HttpVersion::HTTP_11(),
- HostHttpHeader(config->getUrl().getHostname()));
+ HostHttpHeader(config->getUrl().getStrippedHostname()));
config->addBasicAuthHttpHeader(request);
request->setBodyAsJson(command);
request->finalize();
// with the cancel flag set to false.
PostHttpRequestJsonPtr request = boost::make_shared<PostHttpRequestJson>
(HttpRequest::Method::HTTP_POST, "/", HttpVersion::HTTP_11(),
- HostHttpHeader(remote_config->getUrl().getHostname()));
+ HostHttpHeader(remote_config->getUrl().getStrippedHostname()));
remote_config->addBasicAuthHttpHeader(request);
request->setBodyAsJson(CommandCreator::createMaintenanceNotify(false, server_type_));
request->finalize();
// with the cancel flag set to true.
PostHttpRequestJsonPtr request = boost::make_shared<PostHttpRequestJson>
(HttpRequest::Method::HTTP_POST, "/", HttpVersion::HTTP_11(),
- HostHttpHeader(remote_config->getUrl().getHostname()));
+ HostHttpHeader(remote_config->getUrl().getStrippedHostname()));
remote_config->addBasicAuthHttpHeader(request);
request->setBodyAsJson(CommandCreator::createMaintenanceNotify(true, server_type_));
request->finalize();
// Create HTTP/1.1 request including our command.
PostHttpRequestJsonPtr request = boost::make_shared<PostHttpRequestJson>
(HttpRequest::Method::HTTP_POST, "/", HttpVersion::HTTP_11(),
- HostHttpHeader(remote_config->getUrl().getHostname()));
+ HostHttpHeader(remote_config->getUrl().getStrippedHostname()));
remote_config->addBasicAuthHttpHeader(request);
request->setBodyAsJson(CommandCreator::createSyncCompleteNotify(server_type_));
-// Copyright (C) 2017-2021 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2022 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// @throw InvalidOperation if URL is invalid.
Scheme getScheme() const;
- /// @brief Returns hostname.
- ///
- /// @throw InvalidOperation if URL is invalid.
- std::string getHostname() const;
-
/// @brief Returns hostname stripped from [ ] characters surrounding
/// IPv6 address.
///
- /// @throw InvalidOperation of URL is invalid.
+ /// @throw InvalidOperation if URL is invalid.
std::string getStrippedHostname() const;
/// @brief Returns port number.
}
private:
+ /// @brief Returns hostname.
+ ///
+ /// @throw InvalidOperation if URL is invalid.
+ std::string getHostname() const;
/// @brief Returns boolean value indicating if the URL is valid.
void checkValid() const;