From 15621b72842ad7dc1b1be1a480045498cf815f9b Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 31 Jan 2024 13:58:26 -0500 Subject: [PATCH] Pleroma.HTTP.RequestBuilder: fix gradient error lib/pleroma/http/request_builder.ex: The variable key on line 69 is expected to have type String.t() but it has type atom() --- lib/pleroma/http/request_builder.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/http/request_builder.ex b/lib/pleroma/http/request_builder.ex index f16fb3b35..0a028a64c 100644 --- a/lib/pleroma/http/request_builder.ex +++ b/lib/pleroma/http/request_builder.ex @@ -54,12 +54,12 @@ defmodule Pleroma.HTTP.RequestBuilder do @doc """ Add optional parameters to the request """ - @spec add_param(Request.t(), atom(), atom(), any()) :: Request.t() + @spec add_param(Request.t(), atom(), atom() | String.t(), any()) :: Request.t() def add_param(request, :query, :query, values), do: %{request | query: values} def add_param(request, :body, :body, value), do: %{request | body: value} - def add_param(request, :body, key, value) do + def add_param(request, :body, key, value) when is_binary(key) do request |> Map.put(:body, Multipart.new()) |> Map.update!(