Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F21907767
set_format_plug.ex
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
615 B
Referenced Files
None
Subscribers
None
set_format_plug.ex
View Options
# Pleroma: A lightweight social networking server
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma.Plugs.SetFormatPlug
do
import
Plug.Conn
,
only
:
[
assign
:
3
,
fetch_query_params
:
1
]
def
init
(
_
),
do
:
nil
def
call
(
conn
,
_
)
do
case
get_format
(
conn
)
do
nil
->
conn
format
->
assign
(
conn
,
:format
,
format
)
end
end
defp
get_format
(
conn
)
do
conn
.
private
[
:phoenix_format
]
||
case
fetch_query_params
(
conn
)
do
%{
query_params
:
%{
"_format"
=>
format
}}
->
format
_
->
nil
end
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Sun, Dec 28, 1:42 AM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
730721
Default Alt Text
set_format_plug.ex (615 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment