diff --git a/spec/app/finders/interesting_findings/debug_log_spec.rb b/spec/app/finders/interesting_findings/debug_log_spec.rb index 5ddeb294..748d04bd 100644 --- a/spec/app/finders/interesting_findings/debug_log_spec.rb +++ b/spec/app/finders/interesting_findings/debug_log_spec.rb @@ -8,10 +8,16 @@ describe WPScan::Finders::InterestingFindings::DebugLog do let(:wp_content) { 'wp-content' } let(:log_url) { target.url("#{wp_content}/debug.log") } - before { expect(target).to receive(:content_dir).at_least(1).and_return(wp_content) } + before do + expect(target).to receive(:head_or_get_params).and_return(method: :head) + expect(target).to receive(:content_dir).at_least(1).and_return(wp_content) + end describe '#aggressive' do - before { stub_request(:get, log_url).to_return(body: body) } + before do + stub_request(:head, log_url) + stub_request(:get, log_url).to_return(body: body) + end context 'when empty file' do let(:body) { '' } diff --git a/spec/shared_examples/views/main_theme.rb b/spec/shared_examples/views/main_theme.rb index 901db775..14b7bd3b 100644 --- a/spec/shared_examples/views/main_theme.rb +++ b/spec/shared_examples/views/main_theme.rb @@ -21,7 +21,11 @@ shared_examples 'App::Views::MainTheme' do before do expect(target).to receive(:content_dir).at_least(1).and_return('wp-content') + + # Stub the checks for error/debug logs and readmes to 404 + stub_request(:head, /.*/).and_return(status: 404) stub_request(:get, /.*/) + stub_request(:get, /.*\.css\z/) .to_return(body: File.read(FIXTURES.join('models', 'theme', 'style.css'))) end