facebook-signed-request 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ module Facebook
12
12
  digestor = OpenSSL::Digest::Digest.new('sha256')
13
13
  signature = OpenSSL::HMAC.digest( digestor, @secret, encoded_data )
14
14
  encoded_signature = Base64.strict_encode64( signature )
15
- encoded_signature = encoded_signature.gsub('+','_').gsub('/', '_')
15
+ encoded_signature = encoded_signature.tr('+/', '-_')
16
16
 
17
17
  "#{encoded_signature}.#{encoded_data}"
18
18
  end
@@ -59,7 +59,7 @@ module Facebook
59
59
  def base64_url_decode( encoded_string_orig )
60
60
  encoded_string = encoded_string_orig.dup
61
61
  encoded_string << '=' until ( encoded_string.length % 4 == 0 )
62
- Base64.strict_decode64(encoded_string.gsub("-", "+").gsub("_", "/"))
62
+ Base64.strict_decode64(encoded_string.tr('-_','+/'))
63
63
  end
64
64
 
65
65
  def extract_request_signature
@@ -1,5 +1,5 @@
1
1
  module Facebook
2
2
  class SignedRequest
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebook-signed-request
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: