diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-12-15 17:04:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-15 17:04:38 +0100 |
commit | 673c54f114be78e0588f2bb883f2962dbc7574a7 (patch) | |
tree | 0287bece36377a8b16f0244acb44f57c16366cc1 /app/lib/request.rb | |
parent | bbc49f15e030df4e75af06ece8c5302b80b69342 (diff) |
Fix inability to use local LibreTranslate without setting ALLOWED_PRIVATE_ADDRESSES (#21926)
Fixes #20029
Diffstat (limited to 'app/lib/request.rb')
-rw-r--r-- | app/lib/request.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/lib/request.rb b/app/lib/request.rb index 96d934a8f..b2819c8ed 100644 --- a/app/lib/request.rb +++ b/app/lib/request.rb @@ -30,7 +30,8 @@ class Request @verb = verb @url = Addressable::URI.parse(url).normalize @http_client = options.delete(:http_client) - @options = options.merge(socket_class: use_proxy? ? ProxySocket : Socket) + @allow_local = options.delete(:allow_local) + @options = options.merge(socket_class: use_proxy? || @allow_local ? ProxySocket : Socket) @options = @options.merge(proxy_url) if use_proxy? @headers = {} |