Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix Ruby SDK
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Olofsson
Matrix Ruby SDK
Commits
1d01dd94
Verified
Commit
1d01dd94
authored
5 years ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Add comments to HS discovery
parent
790cb5f4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/matrix_sdk/api.rb
+2
-0
2 additions, 0 deletions
lib/matrix_sdk/api.rb
with
2 additions
and
0 deletions
lib/matrix_sdk/api.rb
+
2
−
0
View file @
1d01dd94
...
@@ -98,6 +98,7 @@ module MatrixSdk
...
@@ -98,6 +98,7 @@ module MatrixSdk
target_uri
=
nil
target_uri
=
nil
if
!
port
.
nil?
&&
!
port
.
empty?
if
!
port
.
nil?
&&
!
port
.
empty?
# If the domain is fully qualified according to Matrix (FQDN and port) then skip discovery
target_uri
=
URI
(
"https://
#{
domain
}
:
#{
port
}
"
)
target_uri
=
URI
(
"https://
#{
domain
}
:
#{
port
}
"
)
elsif
target
==
:server
elsif
target
==
:server
# Attempt SRV record discovery
# Attempt SRV record discovery
...
@@ -110,6 +111,7 @@ module MatrixSdk
...
@@ -110,6 +111,7 @@ module MatrixSdk
end
end
if
target_uri
.
nil?
if
target_uri
.
nil?
# Attempt .well-known discovery for server-to-server
well_known
=
begin
well_known
=
begin
data
=
Net
::
HTTP
.
get
(
"https://
#{
domain
}
/.well-known/matrix/server"
)
data
=
Net
::
HTTP
.
get
(
"https://
#{
domain
}
/.well-known/matrix/server"
)
JSON
.
parse
(
data
)
JSON
.
parse
(
data
)
...
...
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