[core,gateway] use FREERDP_USER_AGENT define

Define FREERDP_USER_AGENT in version.h to be used by gateway http user
agent
This commit is contained in:
akallabeth 2024-01-24 14:29:25 +01:00 committed by akallabeth
parent ebebc5b2a7
commit cefe847683
3 changed files with 7 additions and 4 deletions

View File

@ -28,5 +28,6 @@
#define FREERDP_VERSION "${FREERDP_VERSION}"
#define FREERDP_VERSION_FULL "${FREERDP_VERSION_FULL}"
#define FREERDP_GIT_REVISION "${GIT_REVISION}"
#define FREERDP_USER_AGENT "FreeRDP/${FREERDP_VERSION_FULL}"
#endif /* FREERDP_VERSION_H */

View File

@ -19,6 +19,7 @@
*/
#include <freerdp/config.h>
#include <freerdp/version.h>
#include "../settings.h"
@ -871,8 +872,8 @@ static BOOL arm_handle_request(rdpArm* arm, BOOL* retry, DWORD timeout)
!http_context_set_cache_control(arm->http, "no-cache") ||
!http_context_set_pragma(arm->http, "no-cache") ||
!http_context_set_connection(arm->http, "Keep-Alive") ||
!http_context_set_user_agent(arm->http, "FreeRDP/3.0") ||
!http_context_set_x_ms_user_agent(arm->http, "FreeRDP/3.0") ||
!http_context_set_user_agent(arm->http, FREERDP_USER_AGENT) ||
!http_context_set_x_ms_user_agent(arm->http, FREERDP_USER_AGENT) ||
!http_context_set_host(arm->http, freerdp_settings_get_string(arm->context->settings,
FreeRDP_GatewayHostname)))
goto arm_error;

View File

@ -18,6 +18,7 @@
*/
#include <freerdp/config.h>
#include <freerdp/version.h>
#include <winpr/assert.h>
@ -810,8 +811,8 @@ rdpWst* wst_new(rdpContext* context)
!http_context_set_cache_control(wst->http, "no-cache") ||
!http_context_set_pragma(wst->http, "no-cache") ||
!http_context_set_connection(wst->http, "Keep-Alive") ||
!http_context_set_user_agent(wst->http, "FreeRDP/3.0") ||
!http_context_set_x_ms_user_agent(wst->http, "FreeRDP/3.0") ||
!http_context_set_user_agent(wst->http, FREERDP_USER_AGENT) ||
!http_context_set_x_ms_user_agent(wst->http, FREERDP_USER_AGENT) ||
!http_context_set_host(wst->http, wst->gwhostname) ||
!http_context_enable_websocket_upgrade(wst->http, TRUE))
{