From e2d8425891a47f4ae1a2e164701dd53f39eb071b Mon Sep 17 00:00:00 2001 From: Nathan Youngman Date: Wed, 19 Jun 2024 15:00:14 -0600 Subject: [PATCH 1/4] update travis ci --- .travis.yml | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 176c29e..b5da12e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,8 @@ language: elixir notifications: - recipients: - - eduardo@gurgel.me + email: + recipients: + - eduardo@gurgel.me cache: directories: - _build @@ -10,16 +11,19 @@ sudo: false script: mix test matrix: include: - otp_release: 21.0 - - elixir: 1.7 - otp_release: 19.3 - - elixir: 1.7 - otp_release: 20.3 - - elixir: 1.7 - otp_release: 21.0 - - elixir: 1.8 - otp_release: 20.3 - - elixir: 1.8 - otp_release: 21.0 - - elixir: 1.8 - otp_release: 22.0.1 + - elixir: '1.7' + otp_release: '19.3' + - elixir: '1.7' + otp_release: '20.3' + - elixir: '1.7' + otp_release: '21.0' + - elixir: '1.8' + otp_release: '20.3' + - elixir: '1.8' + otp_release: '21.0' + - elixir: '1.8' + otp_release: '22.0.1' + - elixir: '1.15.8' + otp_release: '25.3.2.12' + - elixir: '1.16.3' + otp_release: '26.2.5' From 91ee69c7cf819989854700bf950afe9615cc8166 Mon Sep 17 00:00:00 2001 From: Nathan Youngman Date: Wed, 19 Jun 2024 15:00:31 -0600 Subject: [PATCH 2/4] resolve compiler warnings --- config/config.exs | 3 +-- lib/httparrot.ex | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/config/config.exs b/config/config.exs index f2876a0..4bb5f83 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,4 +1,4 @@ -import Mix.Config +import Config port = System.get_env("PORT", "8080") port = String.to_integer(port) @@ -14,4 +14,3 @@ config :httparrot, https_port: ssl_port, unix_socket: unix_socket, socket_path: System.get_env("SOCKET_PATH", "httparrot.sock") - diff --git a/lib/httparrot.ex b/lib/httparrot.ex index 5f4245c..bab8739 100644 --- a/lib/httparrot.ex +++ b/lib/httparrot.ex @@ -7,7 +7,7 @@ defmodule HTTParrot do end def init(_) do - supervise([], strategy: :simple_one_for_one) + Supervisor.start_link([], [strategy: :one_for_one]) end def start(_type, _args) do From e37f6f387c20150c9a134add19785671773de891 Mon Sep 17 00:00:00 2001 From: Nathan Youngman Date: Wed, 19 Jun 2024 15:02:41 -0600 Subject: [PATCH 3/4] update all dependencies --- mix.exs | 6 +++--- mix.lock | 23 +++++++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/mix.exs b/mix.exs index 830986e..4a1c1b4 100644 --- a/mix.exs +++ b/mix.exs @@ -26,12 +26,12 @@ defmodule Httparrot.Mixfile do defp deps do [ - {:cowboy, "~> 2.8.0"}, + {:cowboy, "~> 2.12.0"}, {:exjsx, "~> 3.0 or ~> 4.0"}, - {:con_cache, "~> 0.14.0"}, + {:con_cache, "~> 1.1.0"}, {:earmark, "~> 1.0", only: :dev}, {:ex_doc, "~> 0.18", only: :dev}, - {:meck, "~> 0.8.13", only: :test} + {:meck, "~> 0.9.2", only: :test} ] end diff --git a/mix.lock b/mix.lock index 41c9d43..7fce543 100644 --- a/mix.lock +++ b/mix.lock @@ -1,15 +1,18 @@ %{ - "con_cache": {:hex, :con_cache, "0.14.0", "863acb90fa08017be3129074993af944cf7a4b6c3ee7c06c5cd0ed6b94fbc223", [:mix], [], "hexpm", "50887a8949377d0b707a3c6653b7610de06074751b52d0f267f52135f391aece"}, - "cowboy": {:hex, :cowboy, "2.8.0", "f3dc62e35797ecd9ac1b50db74611193c29815401e53bac9a5c0577bd7bc667d", [:rebar3], [{:cowlib, "~> 2.9.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "4643e4fba74ac96d4d152c75803de6fad0b3fa5df354c71afdd6cbeeb15fac8a"}, - "cowlib": {:hex, :cowlib, "2.9.1", "61a6c7c50cf07fdd24b2f45b89500bb93b6686579b069a89f88cb211e1125c78", [:rebar3], [], "hexpm", "e4175dc240a70d996156160891e1c62238ede1729e45740bdd38064dad476170"}, - "earmark": {:hex, :earmark, "1.4.6", "f14260802d8998f30e1654189a0d1699c4aa7d099eb4dad904eb5f41283a70b2", [:mix], [], "hexpm", "c1653a90f63400d029b783a098f4d70a40418ddff14da4cc156a0fee9e72e8d6"}, - "ex_doc": {:hex, :ex_doc, "0.22.1", "9bb6d51508778193a4ea90fa16eac47f8b67934f33f8271d5e1edec2dc0eee4c", [:mix], [{:earmark, "~> 1.4.0", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "d957de1b75cb9f78d3ee17820733dc4460114d8b1e11f7ee4fd6546e69b1db60"}, + "con_cache": {:hex, :con_cache, "1.1.0", "45c7c6cd6dc216e47636232e8c683734b7fe293221fccd9454fa1757bc685044", [:mix], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "8655f2ae13a1e56c8aef304d250814c7ed929c12810f126fc423ecc8e871593b"}, + "cowboy": {:hex, :cowboy, "2.12.0", "f276d521a1ff88b2b9b4c54d0e753da6c66dd7be6c9fca3d9418b561828a3731", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "8a7abe6d183372ceb21caa2709bec928ab2b72e18a3911aa1771639bef82651e"}, + "cowlib": {:hex, :cowlib, "2.13.0", "db8f7505d8332d98ef50a3ef34b34c1afddec7506e4ee4dd4a3a266285d282ca", [:make, :rebar3], [], "hexpm", "e1e1284dc3fc030a64b1ad0d8382ae7e99da46c3246b815318a4b848873800a4"}, + "earmark": {:hex, :earmark, "1.4.46", "8c7287bd3137e99d26ae4643e5b7ef2129a260e3dcf41f251750cb4563c8fb81", [:mix], [], "hexpm", "798d86db3d79964e759ddc0c077d5eb254968ed426399fbf5a62de2b5ff8910a"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"}, + "ex_doc": {:hex, :ex_doc, "0.34.0", "ab95e0775db3df71d30cf8d78728dd9261c355c81382bcd4cefdc74610bef13e", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "60734fb4c1353f270c3286df4a0d51e65a2c1d9fba66af3940847cc65a8066d7"}, "exactor": {:hex, :exactor, "2.2.3", "a6972f43bb6160afeb73e1d8ab45ba604cd0ac8b5244c557093f6e92ce582786", [:mix], [], "hexpm"}, "exjsx": {:hex, :exjsx, "4.0.0", "60548841e0212df401e38e63c0078ec57b33e7ea49b032c796ccad8cde794b5c", [:mix], [{:jsx, "~> 2.8.0", [hex: :jsx, repo: "hexpm", optional: false]}], "hexpm", "32e95820a97cffea67830e91514a2ad53b888850442d6d395f53a1ac60c82e07"}, "jsx": {:hex, :jsx, "2.8.3", "a05252d381885240744d955fbe3cf810504eb2567164824e19303ea59eef62cf", [:mix, :rebar3], [], "hexpm", "fc3499fed7a726995aa659143a248534adc754ebd16ccd437cd93b649a95091f"}, - "makeup": {:hex, :makeup, "1.0.3", "e339e2f766d12e7260e6672dd4047405963c5ec99661abdc432e6ec67d29ef95", [:mix], [{:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "2e9b4996d11832947731f7608fed7ad2f9443011b3b479ae288011265cdd3dad"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.14.1", "4f0e96847c63c17841d42c08107405a005a2680eb9c7ccadfd757bd31dabccfb", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f2438b1a80eaec9ede832b5c41cd4f373b38fd7aa33e3b22d9db79e640cbde11"}, - "meck": {:hex, :meck, "0.8.13", "ffedb39f99b0b99703b8601c6f17c7f76313ee12de6b646e671e3188401f7866", [:rebar3], [], "hexpm", "d34f013c156db51ad57cc556891b9720e6a1c1df5fe2e15af999c84d6cebeb1a"}, - "nimble_parsec": {:hex, :nimble_parsec, "0.6.0", "32111b3bf39137144abd7ba1cce0914533b2d16ef35e8abc5ec8be6122944263", [:mix], [], "hexpm", "27eac315a94909d4dc68bc07a4a83e06c8379237c5ea528a9acff4ca1c873c52"}, - "ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm", "451d8527787df716d99dc36162fca05934915db0b6141bbdac2ea8d3c7afc7d7"}, + "makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"}, + "makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"}, + "makeup_erlang": {:hex, :makeup_erlang, "1.0.0", "6f0eff9c9c489f26b69b61440bf1b238d95badae49adac77973cbacae87e3c2e", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "ea7a9307de9d1548d2a72d299058d1fd2339e3d398560a0e46c27dab4891e4d2"}, + "meck": {:hex, :meck, "0.9.2", "85ccbab053f1db86c7ca240e9fc718170ee5bda03810a6292b5306bf31bae5f5", [:rebar3], [], "hexpm", "81344f561357dc40a8344afa53767c32669153355b626ea9fcbc8da6b3045826"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, + "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, + "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, } From 51f8a81cd9d0d6707ab50e6665c17ccc643a8843 Mon Sep 17 00:00:00 2001 From: Nathan Youngman Date: Wed, 19 Jun 2024 15:04:05 -0600 Subject: [PATCH 4/4] warning: negative steps are not supported in String.slice/2, pass 1..-1//1 instead --- lib/httparrot/p_handler.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/httparrot/p_handler.ex b/lib/httparrot/p_handler.ex index 57983ef..7354762 100644 --- a/lib/httparrot/p_handler.ex +++ b/lib/httparrot/p_handler.ex @@ -13,7 +13,7 @@ defmodule HTTParrot.PHandler do """ def allowed_methods(req, state) do path = :cowboy_req.path(req) - path = String.slice(path, 1..-1) + path = String.slice(path, 1..-1//1) {[String.upcase(path)], req, state} end