about summary refs log tree commit diff
path: root/app/lib/translation_service/libre_translate.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-12-15 17:04:38 +0100
committerGitHub <noreply@github.com>2022-12-15 17:04:38 +0100
commit673c54f114be78e0588f2bb883f2962dbc7574a7 (patch)
tree0287bece36377a8b16f0244acb44f57c16366cc1 /app/lib/translation_service/libre_translate.rb
parentbbc49f15e030df4e75af06ece8c5302b80b69342 (diff)
Fix inability to use local LibreTranslate without setting ALLOWED_PRIVATE_ADDRESSES (#21926)
Fixes #20029
Diffstat (limited to 'app/lib/translation_service/libre_translate.rb')
-rw-r--r--app/lib/translation_service/libre_translate.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/lib/translation_service/libre_translate.rb b/app/lib/translation_service/libre_translate.rb
index 43576e306..4ebe21e45 100644
--- a/app/lib/translation_service/libre_translate.rb
+++ b/app/lib/translation_service/libre_translate.rb
@@ -27,7 +27,7 @@ class TranslationService::LibreTranslate < TranslationService
 
   def request(text, source_language, target_language)
     body = Oj.dump(q: text, source: source_language.presence || 'auto', target: target_language, format: 'html', api_key: @api_key)
-    req = Request.new(:post, "#{@base_url}/translate", body: body)
+    req = Request.new(:post, "#{@base_url}/translate", body: body, allow_local: true)
     req.add_headers('Content-Type': 'application/json')
     req
   end