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
Alex Gleason
pleroma
Commits
f0352480
Commit
f0352480
authored
7 years ago
by
Roger Braun
Browse files
Options
Downloads
Patches
Plain Diff
Try host-meta call over https.
parent
07b69481
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/pleroma/web/web_finger/web_finger.ex
+7
-7
7 additions, 7 deletions
lib/pleroma/web/web_finger/web_finger.ex
with
7 additions
and
7 deletions
lib/pleroma/web/web_finger/web_finger.ex
+
7
−
7
View file @
f0352480
...
...
@@ -62,11 +62,6 @@ def ensure_keys_present(user) do
end
end
# FIXME: Make this call the host-meta to find the actual address.
defp
webfinger_address
(
domain
)
do
"//
#{
domain
}
/.well-known/webfinger"
end
defp
webfinger_from_xml
(
doc
)
do
magic_key
=
XML
.
string_from_xpath
(
~s{//Link[@rel="magic-public-key"]/@href}
,
doc
)
"data:application/magic-public-key,"
<>
magic_key
=
magic_key
...
...
@@ -91,10 +86,15 @@ def get_template_from_xml(body) do
end
def
find_lrdd_template
(
domain
)
do
with
{
:ok
,
%{
status_code:
status_code
,
body:
body
}}
<-
@httpoison
.
get
(
"http://
#{
domain
}
/.well-known/host-meta"
,
[],
follow_redirect:
true
)
do
with
{
:ok
,
%{
status_code:
status_code
,
body:
body
}}
when
status_code
in
200
..
299
<-
@httpoison
.
get
(
"http://
#{
domain
}
/.well-known/host-meta"
,
[],
follow_redirect:
true
)
do
get_template_from_xml
(
body
)
else
e
->
{
:error
,
"Can't find lrdd template:
#{
inspect
(
e
)
}
"
}
e
->
with
{
:ok
,
%{
body:
body
}}
<-
@httpoison
.
get
(
"https://
#{
domain
}
/.well-known/host-meta"
,
[])
do
get_template_from_xml
(
body
)
else
e
->
{
:error
,
"Can't find lrdd template:
#{
inspect
(
e
)
}
"
}
end
end
end
...
...
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