1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-07 19:13:20 +00:00

set the user-agent to 'meshagent source_commit_date' (#231)

This commit is contained in:
Simon Smith
2024-01-30 14:58:05 +00:00
committed by GitHub
parent 813c3452fb
commit 25050d4566

View File

@@ -4129,6 +4129,13 @@ void MeshServer_ConnectEx(MeshAgentHostContainer *agent)
ILibAddHeaderLine(req, "Host", 4, ILibScratchPad, (int)sprintf_s(ILibScratchPad, sizeof(ILibScratchPad), "%s:%u", host, port));
}
// Set User-Agent for proxies to identify agents and versions
const char* FieldData = "MeshAgent ";
char combined[40];
strcpy(combined, FieldData);
strcat(combined, SOURCE_COMMIT_DATE);
ILibAddHeaderLine(req, "User-Agent", 10, combined, (int)strnlen_s(combined, 50));
free(path);
if (useproxy != 0 || meshServer.sin6_family != AF_UNSPEC)