R15Bを入れたらerlang-oauthが動かなくなった
先日リリースされたR15Bで http_uri:parse/1 の返り値が変わったようです:
$ erl
Erlang R14B02 (erts-5.8.3) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.8.3 (abort with ^G)
1> http_uri:parse("https://userstream.twitter.com/2/user.json").
{https,[],"userstream.twitter.com",443,"/2/user.json",[]}
2> $ erl
Erlang R15B (erts-5.9) [source] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.9 (abort with ^G)
1> http_uri:parse("https://userstream.twitter.com/2/user.json").
{ok,{https,[],"userstream.twitter.com",443,"/2/user.json",
[]}}
2> で、このせいで erlang-oauth がR15Bで動かないorz...
PS. ちょっと直したら行けるようになったのでTim(作者様)にpull request送ったら10分後にはマージされてましたww
https://github.com/naoyat/erlang-oauth/commit/89ebe2cf9afc08ba5f32deb7d8a333f0a28a50e6
diff --git a/src/oauth.erl b/src/oauth.erl
index 5fc563e..d7257ad 100644
--- a/src/oauth.erl
+++ b/src/oauth.erl
@@ -228,6 +228,8 @@ header_param_decode(Param) ->
uri_normalize(URI) ->
case http_uri:parse(URI) of
+ {ok, {Scheme, UserInfo, Host, Port, Path, _Query}} -> % R15B
+ uri_normalize(Scheme, UserInfo, string:to_lower(Host), Port, [Path]);
{Scheme, UserInfo, Host, Port, Path, _Query} ->
uri_normalize(Scheme, UserInfo, string:to_lower(Host), Port, [Path]);
Else ->