Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33103338
hackney.ex
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
928 B
Referenced Files
None
Subscribers
None
hackney.ex
View Options
# Pleroma: A lightweight social networking server
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma.HTTP.AdapterHelper.Hackney
do
@behaviour
Pleroma.HTTP.AdapterHelper
@defaults
[
follow_redirect
:
true
,
force_redirect
:
true
]
@spec
options
(
keyword
(),
URI
.
t
())
::
keyword
()
def
options
(
connection_opts
\\
[],
%
URI
{}
=
uri
)
do
proxy
=
Pleroma.Config
.
get
([
:http
,
:proxy_url
])
config_opts
=
Pleroma.Config
.
get
([
:http
,
:adapter
],
[])
@defaults
|>
Keyword
.
merge
(
config_opts
)
|>
Keyword
.
merge
(
connection_opts
)
|>
add_scheme_opts
(
uri
)
|>
maybe_add_with_body
()
|>
Pleroma.HTTP.AdapterHelper
.
maybe_add_proxy
(
proxy
)
end
defp
add_scheme_opts
(
opts
,
_
),
do
:
opts
defp
maybe_add_with_body
(
opts
)
do
if
opts
[
:max_body
]
do
Keyword
.
put
(
opts
,
:with_body
,
true
)
else
opts
end
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Tue, Jan 20, 1:36 PM (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
973183
Default Alt Text
hackney.ex (928 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment