Skip to content

Commit

Permalink
treat connection labels beginning with : as errors
Browse files Browse the repository at this point in the history
  • Loading branch information
t-horikawa committed Jun 4, 2024
1 parent 838725a commit 02b9eff
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tateyama/endpoint/common/worker_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,14 @@ class worker_common {
return false;
}
auto ci = rq.handshake().client_information();
session_info_.label(ci.connection_label());
std::string connection_label = ci.connection_label();
if (!connection_label.empty()) {
if (connection_label.at(0) == ':') {
notify_client(res, tateyama::proto::diagnostics::Code::INVALID_REQUEST, "invalid connection label");
return false;
}
}
session_info_.label(connection_label);
session_info_.application_name(ci.application_name());
// FIXME handle userName when a credential specification is fixed.

Expand Down

0 comments on commit 02b9eff

Please sign in to comment.