From 8c165a2a18bc7679de0f6da6a10049fcf70cec2a Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Thu, 26 Sep 2024 14:05:34 +0200 Subject: [PATCH] Correctly set User-Host header if a HostName is provided in the config Signed-off-by: Kai-Uwe Hermann --- lib/ocpp/common/websocket/websocket_libwebsockets.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/ocpp/common/websocket/websocket_libwebsockets.cpp b/lib/ocpp/common/websocket/websocket_libwebsockets.cpp index b4c2abafc..dbbaee79f 100644 --- a/lib/ocpp/common/websocket/websocket_libwebsockets.cpp +++ b/lib/ocpp/common/websocket/websocket_libwebsockets.cpp @@ -1218,19 +1218,11 @@ int WebsocketTlsTPM::process_callback(void* wsi_ptr, int callback_reason, void* auto& str = this->connection_options.hostName.value(); EVLOG_info << "User-Host is set to " << str; - if (0 != lws_add_http_header_by_token(wsi, lws_token_indexes::WSI_TOKEN_HOST, - reinterpret_cast(str.c_str()), str.length(), - ptr, end_header)) { - EVLOG_AND_THROW(std::runtime_error("Could not append authorization header.")); - } - - /* if (0 != lws_add_http_header_by_name(wsi, reinterpret_cast("User-Host"), reinterpret_cast(str.c_str()), str.length(), ptr, end_header)) { - EVLOG_AND_THROW(std::runtime_error("Could not append authorization header.")); + EVLOG_AND_THROW(std::runtime_error("Could not append User-Host header.")); } - */ } if (this->connection_options.security_profile == 1 || this->connection_options.security_profile == 2) {