Skip to content
Snippets Groups Projects
Commit d860d166 authored by Leonardo Crauss Daronco's avatar Leonardo Crauss Daronco
Browse files

Make mconf-decrypter work with HTTPS and redirects

It now works with HTTPS URLs and will follow one redirect. The redirect is
useful for when the server being requested redirects HTTP to HTTPS.
parent f44c25f3
No related branches found
No related tags found
No related merge requests found
......@@ -40,11 +40,25 @@ $recording_dir = bbb_props['recording_dir']
$raw_dir = "#{$recording_dir}/raw"
$archived_dir = "#{$recording_dir}/status/archived"
def getRequest(url)
BigBlueButton.logger.info("Fetching #{url}")
url_parsed = URI.parse(url)
http = Net::HTTP.new(url_parsed.host, url_parsed.port)
http.use_ssl = (url_parsed.scheme.downcase == "https")
http.get(url_parsed.request_uri)
end
def fetchRecordings(url)
#BigBlueButton.logger.debug("Fetching #{url}")
doc = nil
begin
doc = Nokogiri::XML(Net::HTTP.get_response(URI.parse(url)).body)
response = getRequest(url)
# follow redirects once only
if response.kind_of?(Net::HTTPRedirection)
BigBlueButton.logger.info("Received a redirect, will make a new request")
response = getRequest(response['location'])
end
doc = Nokogiri::XML(response.body)
returncode = doc.xpath("//returncode")
if returncode.empty? or returncode.text != "SUCCESS"
BigBlueButton.logger.error "getRecordings didn't return success:\n#{doc.to_xml(:indent => 2)}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment