parroty / exvcr

HTTP request/response recording library for elixir, inspired by VCR.
MIT License
722 stars 132 forks source link

ExVCR.Adapter.Hackney doesn't work with head requests #83

Closed StanBright closed 7 years ago

StanBright commented 7 years ago

It seems that ExVCR.Adapter.Hackney doesn't work with head requests.

If I use HTTPoison.head(url, headers, options) inside of use_cassette block, the relevant test fails with something like:

** (FunctionClauseError) no function clause matching in ExVCR.Adapter.Hackney.apply_filters/1
     stacktrace:
       lib/exvcr/adapter/hackney.ex:54: ExVCR.Adapter.Hackney.apply_filters({:ok, 301, [{"Server", "nginx"}, {"Date", "Thu, 24 Nov 2016 16:19:29 GMT"}, {"Content-Type", "text/html; charset=UTF-8"}, {"Connection", "keep-alive"}, {"Location", "https://dribbble.com/jobs/11990?source=feed"}, {"X-Cache", "MISS"}]})
       lib/exvcr/handler.ex:136: ExVCR.Handler.get_response_from_server/2
       (hackney) :hackney.request(:head, "https://somesite.com/some-path", [], "", [:insecure])
       lib/httpoison/base.ex:422: HTTPoison.Base.request/9

Any ideas how this could be fixed/patched? I am presuming that should be something simple, as long as one knows the internals...

parroty commented 7 years ago

Sorry not being responding this item. I'm closing this item as for #91, but if there's remaining issue, please reopen or open another one.