diff --git a/contrib/src/opendht/SHA512SUMS b/contrib/src/opendht/SHA512SUMS index 968b94b3d5073df6f4a73993e2d4c889002eeefb..acb5b1c9e9a6d2f3a7979183a2195138530a5189 100644 --- a/contrib/src/opendht/SHA512SUMS +++ b/contrib/src/opendht/SHA512SUMS @@ -1 +1 @@ -4533b12c6269b4762425a10428fef42458a5f20372b6f633aa1a14b4b4ab417d64a15fcc012685543687a34e5639824469b8478d352532888af3f8bd7f8592f9 opendht-739f4d0c0d6aff5dd18d84269fe2e276e0530433.tar.gz +b9c28f1c540fa180224571cae186296442069619af11d0079f52554eb7af2bcb254cad3dddc49ef25e8b9ad8c9d97b924de0db07027f01b772c924421310bc27 opendht-104a9e3b283d3b8d7d86e31b7d911ca000a6e7ad.tar.gz diff --git a/contrib/src/opendht/fetch_and_patch.bat b/contrib/src/opendht/fetch_and_patch.bat index 09efab0d5e6246e914ad60d2554a3d549d0821c8..720cabec468e8624dd7c3c094c60e7cb54aaad41 100644 --- a/contrib/src/opendht/fetch_and_patch.bat +++ b/contrib/src/opendht/fetch_and_patch.bat @@ -1,6 +1,6 @@ set BUILD=%SRC%..\build -set OPENDHT_VERSION=739f4d0c0d6aff5dd18d84269fe2e276e0530433 +set OPENDHT_VERSION=104a9e3b283d3b8d7d86e31b7d911ca000a6e7ad set OPENDHT_URL=https://github.com/savoirfairelinux/opendht/archive/%OPENDHT_VERSION%.tar.gz mkdir %BUILD% diff --git a/contrib/src/opendht/rules.mak b/contrib/src/opendht/rules.mak index b12a59bd69a34b7cc37ac32608056ea9b19e75cd..786da51287166f10caf1b2038c0fb753ccbb471d 100644 --- a/contrib/src/opendht/rules.mak +++ b/contrib/src/opendht/rules.mak @@ -1,5 +1,5 @@ # OPENDHT -OPENDHT_VERSION := 739f4d0c0d6aff5dd18d84269fe2e276e0530433 +OPENDHT_VERSION := 104a9e3b283d3b8d7d86e31b7d911ca000a6e7ad OPENDHT_URL := https://github.com/savoirfairelinux/opendht/archive/$(OPENDHT_VERSION).tar.gz PKGS += opendht diff --git a/src/jamidht/server_account_manager.cpp b/src/jamidht/server_account_manager.cpp index b00f8842fbe8791dea3b10c6511d647f03722ac9..a44bc6fb1d1217250454c20bb7de2fafbd269df6 100644 --- a/src/jamidht/server_account_manager.cpp +++ b/src/jamidht/server_account_manager.cpp @@ -51,7 +51,6 @@ ServerAccountManager::ServerAccountManager( void ServerAccountManager::setHeaderFields(Request& request){ - request.set_header_field(restinio::http_field_t::host, request.get_url().host + ":" + request.get_url().service); request.set_header_field(restinio::http_field_t::user_agent, "Jami"); request.set_header_field(restinio::http_field_t::accept, "application/json"); request.set_header_field(restinio::http_field_t::content_type, "application/json"); @@ -83,10 +82,7 @@ ServerAccountManager::initAuthentication( JAMI_WARN("[Auth] authentication with: %s to %s", ctx->credentials->username.c_str(), url.c_str()); auto request = std::make_shared<Request>(*Manager::instance().ioContext(), url, logger_); auto reqid = request->id(); - restinio::http_request_header_t header; - header.method(restinio::http_method_post()); - request->set_header(header); - request->set_target(PATH_DEVICE); + request->set_method(restinio::http_method_post()); request->set_auth(ctx->credentials->username, ctx->credentials->password); { std::stringstream ss; @@ -206,10 +202,7 @@ ServerAccountManager::syncDevices() JAMI_WARN("[Auth] syncDevices with: %s to %s", creds_->username.c_str(), url.c_str()); auto request = std::make_shared<Request>(*Manager::instance().ioContext(), url, logger_); auto reqid = request->id(); - restinio::http_request_header_t header; - header.method(restinio::http_method_get()); - request->set_header(header); - request->set_target(PATH_DEVICE + "?username=" + creds_->username); + request->set_method(restinio::http_method_get()); request->set_auth(creds_->username, creds_->password); setHeaderFields(*request); request->add_on_state_change_callback([reqid, onAsync = onAsync_] @@ -265,10 +258,7 @@ ServerAccountManager::revokeDevice(const std::string& password, const std::strin JAMI_WARN("[Revoke] Removing device of %s at %s", info_->username.c_str(), url.c_str()); auto request = std::make_shared<Request>(*Manager::instance().ioContext(), url, logger_); auto reqid = request->id(); - restinio::http_request_header_t header; - header.method(restinio::http_method_delete()); - request->set_header(header); - request->set_target(PATH_DEVICE + "?deviceId=" + device); + request->set_method(restinio::http_method_delete()); request->set_auth(info_->username, password); setHeaderFields(*request); request->add_on_state_change_callback([reqid, cb, onAsync = onAsync_]