From 2d4b05a74a165ef69fc07f61ea69ccc10f0e47ac Mon Sep 17 00:00:00 2001 From: Rosa Gutierrez Date: Fri, 9 Oct 2026 00:37:49 +0200 Subject: [PATCH] Clear no_proxy in the link preview proxy test Co-Authored-By: Claude Opus 5.5 --- test/models/opengraph/fetch_test.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/models/opengraph/fetch_test.rb b/test/models/opengraph/fetch_test.rb index 561d2cf..3d4f6d6 100644 --- a/test/models/opengraph/fetch_test.rb +++ b/test/models/opengraph/fetch_test.rb @@ -76,7 +76,8 @@ class Opengraph::FetchTest < ActiveSupport::TestCase test "#fetch_document connects to the resolved IP even when a proxy is configured" do url = URI.parse("http://www.example.com/") - saved = ENV.slice("http_proxy", "HTTP_PROXY") + saved = ENV.slice("http_proxy", "HTTP_PROXY", "no_proxy", "NO_PROXY") + %w[ no_proxy NO_PROXY ].each { |k| ENV.delete(k) } %w[ http_proxy HTTP_PROXY ].each { |k| ENV[k] = "http://proxy.internal:3128" } WebMock.disable_net_connect! allow: [ url.host ] @@ -87,7 +88,7 @@ class Opengraph::FetchTest < ActiveSupport::TestCase @fetch.fetch_document(url, ip: "1.2.3.4") end ensure - %w[ http_proxy HTTP_PROXY ].each { |k| ENV.delete(k) } + %w[ http_proxy HTTP_PROXY no_proxy NO_PROXY ].each { |k| ENV.delete(k) } saved.each { |k, v| ENV[k] = v } end