Skip to content
代码片段 群组 项目
提交 1db01726 编辑于 作者: Thong Kuah's avatar Thong Kuah
浏览文件

Merge branch '11951-fix-url-blocker-segfault' into 'master'

Fix random segfaults when running url_blocker_spec

See merge request gitlab-org/gitlab!54404
No related branches found
No related tags found
无相关合并请求
......@@ -167,10 +167,8 @@
subject { described_class.validate!(import_url, dns_rebind_protection: dns_rebind_protection) }
before do
skip 'timeout is not available' unless timeout_available?
stub_env('RSPEC_ALLOW_INVALID_URLS', 'false')
stub_const("#{described_class}::GETADDRINFO_TIMEOUT_SECONDS", 0)
allow(Addrinfo).to receive(:getaddrinfo).and_raise(SocketError)
end
context 'with dns rebinding enabled' do
......@@ -189,17 +187,6 @@
let(:expected_hostname) { nil }
end
end
# Detect whether the timeout option is available.
#
# See https://bugs.ruby-lang.org/issues/15553
def timeout_available?
Addrinfo.getaddrinfo('localhost', nil, timeout: 0)
false
rescue SocketError
true
end
end
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册