Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F21968750
nodeinfo_controller.ex
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
nodeinfo_controller.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.Web.Nodeinfo.NodeinfoController
do
use
Pleroma.Web
,
:controller
alias
Pleroma.Web
alias
Pleroma.Web.Nodeinfo.Nodeinfo
def
schemas
(
conn
,
_params
)
do
response
=
%{
links
:
[
%{
rel
:
"http://nodeinfo.diaspora.software/ns/schema/2.0"
,
href
:
Web
.
base_url
()
<>
"/nodeinfo/2.0.json"
},
%{
rel
:
"http://nodeinfo.diaspora.software/ns/schema/2.1"
,
href
:
Web
.
base_url
()
<>
"/nodeinfo/2.1.json"
}
]
}
json
(
conn
,
response
)
end
# Schema definition: https://github.com/jhass/nodeinfo/blob/master/schemas/2.0/schema.json
# and https://github.com/jhass/nodeinfo/blob/master/schemas/2.1/schema.json
def
nodeinfo
(
conn
,
%{
"version"
=>
version
})
do
case
Nodeinfo
.
get_nodeinfo
(
version
)
do
{
:error
,
:missing
}
->
render_error
(
conn
,
:not_found
,
"Nodeinfo schema version not handled"
)
node_info
->
conn
|>
put_resp_header
(
"content-type"
,
"application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0
#
; charset=utf-8"
)
|>
json
(
node_info
)
end
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Sun, Dec 28, 3:25 AM (2 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
798859
Default Alt Text
nodeinfo_controller.ex (1 KB)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment