changed
README.md
|
@@ -41,7 41,7 @@ Add Assent to your list of dependencies in `mix.exs`:
|
41
41
|
defp deps do
|
42
42
|
[
|
43
43
|
# ...
|
44
|
- {:assent, "~> 0.2.8"}
|
44
|
{:assent, "~> 0.2.9"}
|
45
45
|
]
|
46
46
|
end
|
47
47
|
```
|
changed
hex_metadata.config
|
@@ -2,7 2,7 @@
|
2
2
|
[{<<"GitHub">>,<<"https://github.com/pow-auth/assent">>},
|
3
3
|
{<<"Sponsor">>,<<"https://github.com/sponsors/danschultzer">>}]}.
|
4
4
|
{<<"name">>,<<"assent">>}.
|
5
|
- {<<"version">>,<<"0.2.8">>}.
|
5
|
{<<"version">>,<<"0.2.9">>}.
|
6
6
|
{<<"description">>,<<"Multi-provider framework">>}.
|
7
7
|
{<<"elixir">>,<<"~> 1.12">>}.
|
8
8
|
{<<"app">>,<<"assent">>}.
|
changed
lib/assent/http_adapter/httpc.ex
|
@@ -65,6 65,7 @@ defmodule Assent.HTTPAdapter.Httpc do
|
65
65
|
defp do_httpc_request(url, body, headers) do
|
66
66
|
{content_type, headers} = split_content_type_headers(headers)
|
67
67
|
body = to_charlist(body)
|
68
|
headers = set_content_length_header(headers, body)
|
68
69
|
|
69
70
|
{url, headers, content_type, body}
|
70
71
|
end
|
|
@@ -76,6 77,17 @@ defmodule Assent.HTTPAdapter.Httpc do
|
76
77
|
end
|
77
78
|
end
|
78
79
|
|
80
|
defp set_content_length_header(headers, body) do
|
81
|
case List.keyfind(headers, ~c"content-length", 0) do
|
82
|
nil ->
|
83
|
length = body |> IO.iodata_length() |> Integer.to_string()
|
84
|
[{~c"content-length", length} | headers]
|
85
|
|
86
|
_ ->
|
87
|
headers
|
88
|
end
|
89
|
end
|
90
|
|
79
91
|
defp format_response({:ok, {{_, status, _}, headers, body}}) do
|
80
92
|
headers =
|
81
93
|
Enum.map(headers, fn {key, value} ->
|
changed
lib/assent/strategy.ex
|
@@ -49,7 49,7 @@ defmodule Assent.Strategy do
|
49
49
|
|
50
50
|
@default_http_client Enum.find_value(
|
51
51
|
[
|
52
|
- {Req1, Assent.HTTPAdapter.Req},
|
52
|
{Req, Assent.HTTPAdapter.Req},
|
53
53
|
{:httpc, Assent.HTTPAdapter.Httpc}
|
54
54
|
],
|
55
55
|
fn {dep, module} ->
|
changed
mix.exs
|
@@ -2,7 2,7 @@ defmodule Assent.MixProject do
|
2
2
|
use Mix.Project
|
3
3
|
|
4
4
|
@source_url "https://github.com/pow-auth/assent"
|
5
|
- @version "0.2.8"
|
5
|
@version "0.2.9"
|
6
6
|
|
7
7
|
def project do
|
8
8
|
[
|