From 41367be61fe5c30a4c24bf55bf59b315d2863b5e Mon Sep 17 00:00:00 2001 From: Vasiliy Ermolovich Date: Wed, 15 Nov 2017 11:07:19 +0300 Subject: [PATCH] Fix deprecation warnings for String.strip and Integer.to_char_list. --- lib/httparrot.ex | 2 +- lib/httparrot/p_handler.ex | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/httparrot.ex b/lib/httparrot.ex index 58fb3b1..18c4bd1 100644 --- a/lib/httparrot.ex +++ b/lib/httparrot.ex @@ -86,7 +86,7 @@ defmodule HTTParrot do def prettify_json(status, headers, body, req) do if JSX.is_json? body do body = JSX.prettify!(body) - headers = List.keystore(headers, "content-length", 0, {"content-length", Integer.to_char_list(String.length(body))}) + headers = List.keystore(headers, "content-length", 0, {"content-length", Integer.to_charlist(String.length(body))}) {:ok, req} = :cowboy_req.reply(status, headers, body, req) req else diff --git a/lib/httparrot/p_handler.ex b/lib/httparrot/p_handler.ex index 790c617..3e543b3 100644 --- a/lib/httparrot/p_handler.ex +++ b/lib/httparrot/p_handler.ex @@ -111,10 +111,10 @@ defmodule HTTParrot.PHandler do defp parse_content_disposition_header(header) do parts = elem(header, 1) |> String.split(";") - |> Enum.map(&String.strip/1) + |> Enum.map(&String.trim/1) for part <- parts, into: %{} do - case String.split(part, "=") |> Enum.map(&String.strip/1) do + case String.split(part, "=") |> Enum.map(&String.trim/1) do [type] -> {:type, type} [key, value] -> {key, String.replace(value, "\"", "")} end