parroty / exvcr

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

Unable to record when specifying a receive_timeout option #208

Closed daveshah closed 11 months ago

daveshah commented 11 months ago

Description

Increasing the timeout by supplying the receive_timeout (or recv_timeout dependent on the client) option produces the below error when the call is being recorded and saved. This issue was reproduced with both the Hackney adapter as well as the Finch adapter.

The client call when using the Hackney adapter looks similar to: HTTPoison.post(@endpoint, body, headers , [recv_timeout: 60_000] And produces:

    ** (FunctionClauseError) no function clause matching in String.valid?/2

     The following arguments were given to String.valid?/2:

         # 1
         60000

         # 2
         :default

     Attempted function clauses (showing 2 out of 2):

         def valid?(<<string::binary>>, :default)
         def valid?(<<string::binary>>, :fast_ascii)

     code: assert {:ok, %{status: 200}} = Api.create_submission(valid_request_body)
     stacktrace:
       (elixir 1.15.4) lib/string.ex:1827: String.valid?/2
       (exvcr 0.14.2) lib/exvcr/filter.ex:10: ExVCR.Filter.filter_sensitive_data/1
      ...