From: William Pitcock Date: Fri, 17 May 2019 19:03:19 +0000 (+0000) Subject: http: request builder: send user-agent when making requests X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=d3b8cd342ff6d1fe87bcfe6305424faf49666252;p=akkoma http: request builder: send user-agent when making requests --- diff --git a/lib/pleroma/http/request_builder.ex b/lib/pleroma/http/request_builder.ex index 5f2cff2c0..522728da1 100644 --- a/lib/pleroma/http/request_builder.ex +++ b/lib/pleroma/http/request_builder.ex @@ -45,8 +45,9 @@ defmodule Pleroma.HTTP.RequestBuilder do Add headers to the request """ @spec headers(map(), list(tuple)) :: map() - def headers(request, h) do - Map.put_new(request, :headers, h) + def headers(request, header_list) do + header_list = header_list ++ [{"User-Agent", Pleroma.Application.user_agent()}] + Map.put_new(request, :headers, header_list) end @doc """