mirror of
https://git.youjo.love/youjo/youjo-be.git
synced 2024-11-20 13:59:55 +01:00
http: request builder: send user-agent when making requests
This commit is contained in:
parent
d2dacadb6b
commit
d3b8cd342f
1 changed files with 3 additions and 2 deletions
|
@ -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 """
|
||||
|
|
Loading…
Reference in a new issue