Comments (6)
@parroty hey I think this sanitizing option fix needs to be applied to ibrowser
adapter(and maybe to all adapters), https://github.com/parroty/exvcr/blob/master/lib/exvcr/adapter/ibrowse/converter.ex#L52.
Had the same error without using the hackney
adapter which my request also doing the basic_auth
.
from exvcr.
Thanks for the report.
It seems failing to encode the information as json, and I would like to check what is being received.
Is there any way that I can access to your code, or request/response information you're sending with your code?
from exvcr.
defmodule ExCloseioTest do
use ExUnit.Case
use ExVCR.Mock, adapter: ExVCR.Adapter.Hackney
setup_all do
ExVCR.Config.cassette_library_dir("fixture/vcr_cassettes", "fixture/custom_cassettes")
HTTPoison.start
:ok
end
test "fetch lead" do
api_key = System.get_env("CLOSEIO_API_KEY")
id = "lead_lw2TrH5eMLnFz70UdF6f8zx3ElL6cPM0MHkgu4IzTFQ"
path = "https://app.close.io/api/v1/lead/#{id}/"
auth = [hackney: [basic_auth: {api_key, ""}]]
use_cassette "fetch_lead" do
lead = HTTPoison.get!(path, [], auth)
assert lead.id, id
end
end
end
If I do IO.inspect(lead)
, lead is an HTTPoison.Response
struct, with the top level keys being:
- status_code
- body
- headers
from exvcr.
Thanks for the information, I could reproduce the error.
It seems the encoding tuples in basic_auth
option is causing the error. I'm not confident how it should be fixed yet, but I'm trying to avoid the error in the above commit (4906359) in the issue_30
branch.
Is it possible for you to retry with the code in the branch? Specifying the branch name in the mix.exs
like the following would use the code.
{:exvcr, github: "parroty/exvcr", branch: "issue_30", only: :test},
from exvcr.
Yep, that worked.
from exvcr.
Thanks! pushed as v0.5.2.
from exvcr.
Related Issues (20)
- Problem with ExJsx dependency HOT 10
- Request was made? HOT 1
- ExVCR.IEx not working with adapter: ExVCR.Adapter.Hackney HOT 2
- disable global mock HOT 14
- Global Mock does not use cassettes with HTTPoison HOT 2
- How to use ExVCR with Finch? HOT 3
- Filter sensitive data after all request made HOT 1
- Support `mix vcr.check --include mytag` ?
- Can't match json response bodies for removing sensitive data? HOT 1
- Cassettes are not injected after test cases! HOT 1
- ** (ArgumentError) argument error
- Support for Finch 0.9.x? HOT 1
- Feature request: `start_cassette` and `stop_cassette`
- Same as vcr request: save response json body with more formatting HOT 1
- Generated custom_cassettes with patchfile HOT 1
- Wrong responses when HTTPoison is used from async Task HOT 4
- Async tests using Bypass interfere with ExVcr tests HOT 3
- support httpoison 2.0 HOT 1
- Version `0.14.0` cannot be compiled in projects not using `Finch`
- Unable to record when specifying a receive_timeout option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exvcr.