Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ilja
pleroma
Commits
2914f8a7
Commit
2914f8a7
authored
5 years ago
by
rinpatch
Committed by
kaniini
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Merge the default options with custom ones in ReverseProxy and
Pleroma.HTTP
parent
8b1b3e84
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/pleroma/http/connection.ex
+1
-1
1 addition, 1 deletion
lib/pleroma/http/connection.ex
lib/pleroma/http/http.ex
+1
-4
1 addition, 4 deletions
lib/pleroma/http/http.ex
lib/pleroma/reverse_proxy.ex
+3
-2
3 additions, 2 deletions
lib/pleroma/reverse_proxy.ex
with
5 additions
and
7 deletions
lib/pleroma/http/connection.ex
+
1
−
1
View file @
2914f8a7
...
...
@@ -29,7 +29,7 @@ def new(opts \\ []) do
# fetch Hackney options
#
def
p
hackney_options
(
opts
)
do
def
hackney_options
(
opts
)
do
options
=
Keyword
.
get
(
opts
,
:adapter
,
[])
adapter_options
=
Pleroma
.
Config
.
get
([
:http
,
:adapter
],
[])
proxy_url
=
Pleroma
.
Config
.
get
([
:http
,
:proxy_url
],
nil
)
...
...
This diff is collapsed.
Click to expand it.
lib/pleroma/http/http.ex
+
1
−
4
View file @
2914f8a7
...
...
@@ -65,10 +65,7 @@ defp process_sni_options(options, url) do
end
def
process_request_options
(
options
)
do
case
Pleroma
.
Config
.
get
([
:http
,
:proxy_url
])
do
nil
->
options
proxy
->
options
++
[
proxy:
proxy
]
end
Keyword
.
merge
(
Pleroma
.
HTTP
.
Connection
.
hackney_options
([]),
options
)
end
@doc
"""
...
...
This diff is collapsed.
Click to expand it.
lib/pleroma/reverse_proxy.ex
+
3
−
2
View file @
2914f8a7
...
...
@@ -61,7 +61,7 @@ defmodule Pleroma.ReverseProxy do
* `http`: options for [hackney](https://github.com/benoitc/hackney).
"""
@default_hackney_options
[]
@default_hackney_options
[
pool:
:media
]
@inline_content_types
[
"image/gif"
,
...
...
@@ -94,7 +94,8 @@ def call(_conn, _url, _opts \\ [])
def
call
(
conn
=
%{
method:
method
},
url
,
opts
)
when
method
in
@methods
do
hackney_opts
=
@default_hackney_options
Pleroma
.
HTTP
.
Connection
.
hackney_options
([])
|>
Keyword
.
merge
(
@default_hackney_options
)
|>
Keyword
.
merge
(
Keyword
.
get
(
opts
,
:http
,
[]))
|>
HTTP
.
process_request_options
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment