summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-07-16 13:59:51 +0300
committerGitHub <noreply@github.com>2026-07-16 13:59:51 +0300
commitb76dce8903f9fd653ab604132c79c091c5476b08 (patch)
treeaa61e996c11aec7291f231be2d384dca40ae5b10
parentda222f77148ac2dce45059a7c895d922465ee1eb (diff)
#5995 Fix azure translation not accepting large keys
And fix escaping, this is json data, not url
-rw-r--r--indra/newview/lltranslate.cpp10
-rw-r--r--indra/newview/skins/default/xui/en/floater_translation_settings.xml2
2 files changed, 3 insertions, 9 deletions
diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp
index dcd1582eb9..2d5baae52e 100644
--- a/indra/newview/lltranslate.cpp
+++ b/indra/newview/lltranslate.cpp
@@ -155,7 +155,7 @@ void LLTranslationAPIHandler::verifyKeyCoro(LLTranslate::EService service, LLSD
{
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
- httpAdapter = std::make_shared<LLCoreHttpUtil::HttpCoroutineAdapter>("getMerchantStatusCoro", httpPolicy);
+ httpAdapter = std::make_shared<LLCoreHttpUtil::HttpCoroutineAdapter>("verifyKeyCoro", httpPolicy);
LLCore::HttpRequest::ptr_t httpRequest = std::make_shared<LLCore::HttpRequest>();
LLCore::HttpOptions::ptr_t httpOpts = std::make_shared<LLCore::HttpOptions>();
LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared<LLCore::HttpHeaders>();
@@ -807,13 +807,7 @@ LLSD LLAzureTranslationHandler::sendMessageAndSuspend(LLCoreHttpUtil::HttpCorout
LLCore::BufferArray::ptr_t rawbody(new LLCore::BufferArray);
LLCore::BufferArrayStream outs(rawbody.get());
- static const std::string allowed_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz "
- "0123456789"
- "-._~";
-
- outs << "[{\"text\":\"";
- outs << LLURI::escape(msg, allowed_chars);
- outs << "\"}]";
+ outs << boost::json::serialize(boost::json::array{ boost::json::object{{ "text", msg }} });
return adapter->postRawAndSuspend(request, url, rawbody, options, headers);
}
diff --git a/indra/newview/skins/default/xui/en/floater_translation_settings.xml b/indra/newview/skins/default/xui/en/floater_translation_settings.xml
index 22dbd80cda..d1df8bf80f 100644
--- a/indra/newview/skins/default/xui/en/floater_translation_settings.xml
+++ b/indra/newview/skins/default/xui/en/floater_translation_settings.xml
@@ -228,7 +228,7 @@
height="20"
layout="topleft"
left_pad="10"
- max_length_chars="50"
+ max_length_chars="100"
top_delta="-4"
name="azure_api_key"
width="210" />