mirror of
https://github.com/edgurgel/httparrot
synced 2025-04-10 12:12:24 -04:00
Merge pull request #30 from nashby/fix/deprecations
Fix deprecation warnings for String.strip and Integer.to_char_list.
This commit is contained in:
commit
f3ed8f8ba3
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue