Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly set User-Host header if a HostName is provided in the config #805

Merged
merged 1 commit into from
Sep 26, 2024
Merged
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
10 changes: 1 addition & 9 deletions lib/ocpp/common/websocket/websocket_libwebsockets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const unsigned char*>(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<const unsigned char*>("User-Host"),
reinterpret_cast<const unsigned char*>(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) {
Expand Down
Loading