Skip to content

Commit

Permalink
Merge pull request #66 from wit-ai/add_plugin_flaour_user_agent
Browse files Browse the repository at this point in the history
add plugin flavor to user agent
  • Loading branch information
wangpingsx authored Jan 26, 2023
2 parents 6e17a8f + 0136d43 commit c2ff0ea
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Source/Wit/Private/Wit/Request/HTTP/WitHttpRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ FString FWitHttpRequest::GetUserAgent()

const FString SdkVersion = WitSdkVersion;

// Plugin flavour

const FString PluginFlavour = FString("Original");

// Editor

#if WITH_EDITOR
Expand All @@ -122,15 +126,16 @@ FString FWitHttpRequest::GetUserAgent()
const FString PluginName = FString("wit-unreal");
#endif

FString UserAgent = FString::Printf(TEXT("%s-%s,%s,%s,%s,%s,%s,%s"),
FString UserAgent = FString::Printf(TEXT("%s-%s,%s,%s,%s,%s,%s,%s,%s"),
*FGenericPlatformHttp::EscapeUserAgentString(UserAgentPrefix),
*FGenericPlatformHttp::EscapeUserAgentString(SdkVersion),
*FGenericPlatformHttp::EscapeUserAgentString(PluginName),
*FGenericPlatformHttp::EscapeUserAgentString(OperatingSystem),
*FGenericPlatformHttp::EscapeUserAgentString(DeviceModel),
*FGenericPlatformHttp::EscapeUserAgentString(ConfigId),
*FGenericPlatformHttp::EscapeUserAgentString(DeviceName),
*FGenericPlatformHttp::EscapeUserAgentString(UserEditor));
*FGenericPlatformHttp::EscapeUserAgentString(UserEditor),
*FGenericPlatformHttp::EscapeUserAgentString(PluginFlavour));

return UserAgent;
}
Expand Down

0 comments on commit c2ff0ea

Please sign in to comment.