From b01feec5294162f6c92b9f1793218181a0f3d44e Mon Sep 17 00:00:00 2001 From: Anatoly Ostrovsky Date: Sun, 10 Dec 2023 08:26:42 +0200 Subject: [PATCH] Change plug method --- lib/nitroux/plug.ex | 6 +++++- mix.exs | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/nitroux/plug.ex b/lib/nitroux/plug.ex index 58df1ee..858491c 100644 --- a/lib/nitroux/plug.ex +++ b/lib/nitroux/plug.ex @@ -1,6 +1,10 @@ defmodule Nitroux.Plug do import Plug.Conn + @spec content( + Plug.Conn.t(), + binary() | maybe_improper_list() + ) :: Plug.Conn.t() def content(conn, data) do data = case data do @@ -9,6 +13,6 @@ defmodule Nitroux.Plug do end %{conn | resp_headers: [{"content-type", "text/html"}]} - |> send_resp(conn.status || 200, data) + |> resp(conn.status || 200, data) end end diff --git a/mix.exs b/mix.exs index 31aea48..f8d222d 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Nitroux.MixProject do def project do [ app: :nitroux, - version: "0.4.0", + version: "0.4.1", elixir: "~> 1.13", name: "nitroux", description: description(), @@ -28,8 +28,9 @@ defmodule Nitroux.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do [ - {:plug, "~> 1.13", runtime: false}, - {:ex_doc, ">= 0.0.0", only: :dev, runtime: false} + {:plug, "~> 1.13"}, + {:ex_doc, ">= 0.0.0", only: :dev, runtime: false}, + {:dialyxir, "~> 1.4.2", only: [:dev]} # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} ] end