-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
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
Escaping of URI delimiter characters #240
Comments
It appears as though the encoding is happening here: Is it appropriate to modify the actual url that is forwarded in the http stack or should the original url be used to make the http call? |
I see there is a small flame on Addressable about [] subquery blah blah. It would be nice if there was a feature that allowed for pass-through non-normalized uri's. |
Hi @kjbkjb Thanks for reporting that. Changes in addressable >= 2.3 are indeed breaking webmock, that's why I just took QueryMapper from addressable < 2.3 https://github.com/bblimke/webmock/blob/master/lib/webmock/util/query_mapper.rb Are you able to provide a test or sample code using webmock that demonstrates this bug? |
Sure, I'll get something to you in the next day or so. |
@whatasunnyday there was no progress unfortunately. Are you experiencing these problems when using VCR with WebMock? |
I am not. I am using Faraday and webmock and found this thread while trying to google my issue. Ruby Version: Gemfile: source 'https://rubygems.org'
gem 'faraday'
gem 'webmock' reproduce.rb require 'faraday'
require 'webmock'
include WebMock::API
URL = 'http://mock.com'
nested_hash = { 'example' => {'a' => 'z' } }
stub_request(:get, URL).with(query: nested_hash)
conn = Faraday.new(:url => URL) do |faraday|
faraday.response :logger
faraday.adapter Faraday.default_adapter
end
conn.post do |req|
req.params = nested_hash
end
Any ideas on how to resolve this? |
Your stub is for a GET request and you make a POST request. Make sure they are the same and it should match fine. |
I think my project actually had this issue but I'm failing to reproduce this correctly. At the time, I had not confused :get and :post. Since my project is OSS, I might be able to find a commit where it exists. I ended up testing it a different way. I'm still interested in helping resolve this bug even if I didn't have it. |
Please let me know if you find a sample code to reproduce it. |
closing this, as it looks like it might be resolved. If you have more information please reopen. Thanks for submitting. |
After upgrading from v1.8.7 to v1.9.0, our tests that use VCR started failing with the following error:
An HTTP request has been made that VCR does not know how to handle:
GET http://localhost:3001/xxxxxxx.json?conditions%5Bxxx_id%5D=1
%5B and %5D are [ and ] respectively. They are general delimiter characters according to section 2.2 of this spec: http://www.ietf.org/rfc/rfc3986.txt
I've tried different versions of rails and vcr to verify that the change happened within WebMock.
The text was updated successfully, but these errors were encountered: