Skip to content
Snippets Groups Projects
Verified Commit 1d01dd94 authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Add comments to HS discovery

parent 790cb5f4
No related branches found
No related tags found
No related merge requests found
...@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment