Avoids merging CLI params when calling VulnAPI - Ref #1451

This commit is contained in:
erwanlr
2020-02-11 09:13:31 +00:00
parent 1b68bdb36c
commit 6b241ce9b3
2 changed files with 18 additions and 10 deletions

View File

@@ -5,10 +5,6 @@ describe WPScan::DB::VulnApi do
let(:request_headers) do
{
'Host' => api.uri.host,
'Expect' => nil,
'Referer' => nil,
'CF-Connecting-IP' => nil,
'User-Agent' => WPScan::Browser.instance.default_user_agent,
'Authorization' => 'Token token=s3cRet'
}
@@ -48,6 +44,16 @@ describe WPScan::DB::VulnApi do
let(:path) { 'path' }
context 'when params used' do
it 'ensures they override the defaults' do
expect(Typhoeus).to receive(:get)
.with(api.uri.join(path), hash_including(cache_ttl: 0))
.and_return(Typhoeus::Response.new(code: 404))
api.get(path, cache_ttl: 0)
end
end
context 'when no timeouts' do
before do
stub_request(:get, api.uri.join(path))