forked from External/greenlight
		
	fix callback tests
This commit is contained in:
		@@ -270,6 +270,7 @@ class BbbController < ApplicationController
 | 
				
			|||||||
  def validate_checksum
 | 
					  def validate_checksum
 | 
				
			||||||
    secret = ENV['BIGBLUEBUTTON_SECRET']
 | 
					    secret = ENV['BIGBLUEBUTTON_SECRET']
 | 
				
			||||||
    checksum = params["checksum"]
 | 
					    checksum = params["checksum"]
 | 
				
			||||||
 | 
					    return false unless checksum
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Decode and break the body into parts.
 | 
					    # Decode and break the body into parts.
 | 
				
			||||||
    parts = URI.decode_www_form(read_body(request))
 | 
					    parts = URI.decode_www_form(read_body(request))
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -176,7 +176,7 @@ class BbbControllerTest < ActionController::TestCase
 | 
				
			|||||||
        "meeting_id": "f344d42cc5ea2fbb7fe64edabce42dae5dc1c0c5-1487709353538"}},
 | 
					        "meeting_id": "f344d42cc5ea2fbb7fe64edabce42dae5dc1c0c5-1487709353538"}},
 | 
				
			||||||
      "timestamp": 1488557092}
 | 
					      "timestamp": 1488557092}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    request.env['RAW_POST_DATA'] = data.to_json
 | 
					    request.env['RAW_POST_DATA'] = URI.encode_www_form(data)
 | 
				
			||||||
    Digest::SHA1.hexdigest(
 | 
					    Digest::SHA1.hexdigest(
 | 
				
			||||||
      "#{data[:event][:payload][:metadata][:'gl-webhooks-callback-url']}#{data.to_json}#{secret}")
 | 
					      "#{data[:event][:payload][:metadata][:'gl-webhooks-callback-url']}#{data.to_json}#{secret}")
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user