Sophie

Sophie

distrib > Mageia > cauldron > i586 > by-pkgid > b3ef820d0ead05765bb6c940248db073 > files > 1

erlang-p1_utils-1.0.12-2.mga7.src.rpm

From: Peter Lemenkov <lemenkov@gmail.com>
Date: Wed, 12 Jul 2017 17:01:37 +0300
Subject: [PATCH] Don't use function from Ejabberd

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>

diff --git a/src/p1_http.erl b/src/p1_http.erl
index fb7594e..21011f4 100644
--- a/src/p1_http.erl
+++ b/src/p1_http.erl
@@ -294,9 +294,13 @@ post(URL, Body) ->
 %% @see request/4
 -spec post(string(), headers(), string()) -> result().
 post(URL, Hdrs, Body) ->
+    ToLower = fun
+		      (B) when is_binary(B) -> iolist_to_binary(string:to_lower(binary_to_list(B)));
+		      (C) -> string:to_lower(C)
+	      end,
     NewHdrs = case [X
 		    || {X, _} <- Hdrs,
-		       str:to_lower(X) == <<"content-type">>]
+		       ToLower(X) == <<"content-type">>]
 		  of
 		[] ->
 		    [{<<"content-type">>, <<"x-www-form-urlencoded">>}