Commit f1f4b186 authored by rinpatch's avatar rinpatch

Merge branch 'fix/user-agent-overriding' into 'develop'

Don't override user-agent header if it's been set

Closes #1923

See merge request !2829
parents 8ca993c7 4bf44b7d
Pipeline #29292 failed with stages
in 17 minutes and 10 seconds
......@@ -34,10 +34,12 @@ def url(request, u), do: %{request | url: u}
@spec headers(Request.t(), Request.headers()) :: Request.t()
def headers(request, headers) do
headers_list =
if Pleroma.Config.get([:http, :send_user_agent]) do
with true <- Pleroma.Config.get([:http, :send_user_agent]),
nil <- Enum.find(headers, fn {key, _val} -> String.downcase(key) == "user-agent" end) do
[{"user-agent", Pleroma.Application.user_agent()} | headers]
_ ->
%{request | headers: headers_list}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment