sinatra-weixin-robot 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sinatra-weixin-robot.rb +1 -1
- data/lib/sinatra/weixin-robot.rb +2 -2
- metadata +1 -1
data/lib/sinatra-weixin-robot.rb
CHANGED
data/lib/sinatra/weixin-robot.rb
CHANGED
@@ -8,8 +8,8 @@ module Sinatra
|
|
8
8
|
module RobotHelpers
|
9
9
|
def generate_signature(token=nil)
|
10
10
|
weixin_token = token || settings.wexin_token
|
11
|
-
|
12
|
-
weixin_sha1 = [
|
11
|
+
timestamp, nonce = params[:timestamp], params[:nonce]
|
12
|
+
weixin_sha1 = [weixin_token.to_s, timestamp.to_s, nonce.to_s].sort!.join
|
13
13
|
Digest::SHA1.hexdigest(weixin_sha1)
|
14
14
|
end
|
15
15
|
|