We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unless I am doing something wrong, it's currently not possible to stub Typhoeus requests with cookies.
stub_request(:get, url) .with(headers: { 'Cookie' => 'key=value' }) .to_return(body: 'Cookies Accepted!')
does not work because Typhoeus does not set the Cookie header it seems, but rather use the :cookie option (https://github.com/typhoeus/ethon/blob/c5c9c6e10114c9939642be522ab05432ca7ec5d2/lib/ethon/curls/options.rb#L340):
@request= #<Typhoeus::Request:0x0000000003619150 @__webmock_request_signature= #<WebMock::RequestSignature:0x000000000361ec68 @body=nil, @headers= {"User-Agent"=>"WPScan v3.5.0 (https://wpscan.org/)", "Expect"=>""}, @method=:get, @uri=#<Addressable::URI:0x1b0f4b8 URI:http://wp.lab/>>, @base_url="http://wp.lab/", @block_connection=false, @on_complete=[], @on_headers=[], @on_progress=[], @on_success=[], @options= {:headers=> {"User-Agent"=>"WPScan v3.5.0 (https://wpscan.org/)", "Expect"=>""}, :accept_encoding=>"gzip, deflate", :method=>:get, :cookie=>"key=value", :followlocation=>true, :maxredirs=>3}, @original_options= {:headers=>{"User-Agent"=>"WPScan v3.5.0 (https://wpscan.org/)"}, :accept_encoding=>"gzip, deflate", :method=>:get, :cookie=>"key=value", :followlocation=>true, :maxredirs=>3}, @response=#<Typhoeus::Response:0x0000000003628d80 ...>>>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Unless I am doing something wrong, it's currently not possible to stub Typhoeus requests with cookies.
does not work because Typhoeus does not set the Cookie header it seems, but rather use the :cookie option (https://github.com/typhoeus/ethon/blob/c5c9c6e10114c9939642be522ab05432ca7ec5d2/lib/ethon/curls/options.rb#L340):
The text was updated successfully, but these errors were encountered: