You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
478 B
24 lines
478 B
class Callbacks::AliyunVodsController < Callbacks::BaseController
|
|
before_action :check_signature_valid!
|
|
|
|
def create
|
|
Videos::DispatchCallbackService.call(params)
|
|
render_ok
|
|
end
|
|
|
|
private
|
|
|
|
def check_signature_valid!
|
|
return if AliyunVod::Sign.verify?(header_signature, header_timestamp)
|
|
|
|
render_not_acceptable
|
|
end
|
|
|
|
def header_timestamp
|
|
request.headers['X-VOD-TIMESTAMP']
|
|
end
|
|
|
|
def header_signature
|
|
request.headers['X-VOD-SIGNATURE']
|
|
end
|
|
end |