use canvas' http library for logout service callback

Raw net::http doesn't support ssl

Test Plan:
 * Test LTI logout service callback to an https endpoint

closes CNVS-16588

Change-Id: I0da743a6cf192b412f7387c37d5278154ba0018e
Reviewed-on: https://gerrit.instructure.com/43602
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
This commit is contained in:
Bracken Mosbacker 2014-10-30 13:15:57 -06:00
parent c1c70a3661
commit 4ac3e4b574
2 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ module Lti
def perform
callbacks.each do |tool_id, callback|
begin
Net::HTTP::get(URI.parse(callback))
CanvasHttp.get(URI.parse(callback).to_s)
rescue => e
Rails.logger.error("Failed to call logout callback '#{callback}': #{e.inspect}")
end

View File

@ -117,7 +117,7 @@ describe LtiApiController, type: :request do
login_as 'parajsa', 'password1'
token = Lti::LogoutService::Token.create(@tool, @pseudonym)
Lti::LogoutService.register_logout_callback(token, 'http://logout.notify.example.com/789')
Net::HTTP.expects(:get).with(URI('http://logout.notify.example.com/789'))
CanvasHttp.expects(:get).with('http://logout.notify.example.com/789')
delete '/logout'
run_jobs
end