Skip to content

Instantly share code, notes, and snippets.

@nicholassm
Created September 20, 2011 09:33
Show Gist options
  • Save nicholassm/1228738 to your computer and use it in GitHub Desktop.
Save nicholassm/1228738 to your computer and use it in GitHub Desktop.
Demonstration of %2B being unencoded in the cassette in VCR (1.11.3)
require 'rubygems'
require 'vcr'
require 'net/http'
VCR.configure do |c|
c.cassette_library_dir = 'cassettes'
c.stub_with :webmock
c.default_cassette_options = { :record => :once }
end
host = "encrypted.google.com"
http = Net::HTTP.new(host, 443)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
url = "/search?abc=%2B"
VCR.use_cassette("example") do
http.request(Net::HTTP::Post.new(url))
end
VCR.use_cassette("example") do
http.request(Net::HTTP::Post.new(url))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment