Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
pleroma
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
391
Issues
391
List
Boards
Labels
Service Desk
Milestones
Merge Requests
54
Merge Requests
54
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pleroma
pleroma
Commits
4bf44b7d
Commit
4bf44b7d
authored
Aug 01, 2020
by
Roman Chvanikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't override user-agent header if it's been set
parent
a1a43f39
Pipeline
#29291
passed with stages
in 20 minutes and 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
lib/pleroma/http/request_builder.ex
lib/pleroma/http/request_builder.ex
+4
-2
No files found.
lib/pleroma/http/request_builder.ex
View file @
4bf44b7d
...
...
@@ -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
]
else
headers
_
->
headers
end
%{
request
|
headers:
headers_list
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment