Skip to content

Commit

Permalink
Merge 38049a0 into 798747c
Browse files Browse the repository at this point in the history
  • Loading branch information
gullitmiranda committed Jul 29, 2015
2 parents 798747c + 38049a0 commit aee3afa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/exvcr/filter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule ExVCR.Filter do
strip_query_params(url)
else
url
end
end |> filter_sensitive_data
end

@doc """
Expand All @@ -46,8 +46,8 @@ defmodule ExVCR.Filter do
end

defp is_header_allowed?(header_name) do
Enum.find(ExVCR.Setting.get(:response_headers_blacklist), fn(x) ->
to_string(header_name) == x
Enum.find(ExVCR.Setting.get(:response_headers_blacklist), fn(x) ->
to_string(header_name) == x
end) == nil
end
end
end
10 changes: 5 additions & 5 deletions lib/exvcr/handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ defmodule ExVCR.Handler do
end

defp match_by_url(response, keys, recorder_options) do
if stub_mode?(recorder_options) do
request_url = response[:request].url
key_url = to_string(keys[:url])
request_url = response[:request].url
key_url = to_string(keys[:url]) |> ExVCR.Filter.filter_sensitive_data

if stub_mode?(recorder_options) do
if match = Regex.run(~r/~r\/(.+)\//, request_url) do
pattern = Regex.compile!(Enum.at(match, 1))
Regex.match?(pattern, key_url)
else
request_url == key_url
end
else
request_url = parse_url(response[:request].url, recorder_options)
key_url = parse_url(keys[:url], recorder_options)
request_url = parse_url(request_url, recorder_options)
key_url = parse_url(key_url, recorder_options)

request_url == key_url
end
Expand Down

0 comments on commit aee3afa

Please sign in to comment.