facebook-signed-request 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -56,7 +56,8 @@ module Facebook
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
def base64_url_decode(
|
59
|
+
def base64_url_decode( encoded_string_orig )
|
60
|
+
encoded_string = encoded_string_orig.dup
|
60
61
|
encoded_string << '=' until ( encoded_string.length % 4 == 0 )
|
61
62
|
Base64.strict_decode64(encoded_string.gsub("-", "+").gsub("_", "/"))
|
62
63
|
end
|
data/test/signed_request_test.rb
CHANGED
@@ -12,7 +12,6 @@ class SignedRequestTest < Test::Unit::TestCase
|
|
12
12
|
@invalid_request_1 = "l0p_bGyDeVZ2I21cJvLd5C9CwpMkU2mcp1eUGWdvWs.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImV4cGlyZXMiOjEzMDg5ODg4MDAsImlzc3VlZF9hdCI6MTMwODk4NTAxOCwib2F1dGhfdG9rZW4iOiIxMTQ5NTIyOTg1OTM4MTN8Mi5BUUJBdHRSbExWbndxTlBaLjM2MDAuMTMwODk4ODgwMC4xLTEwMDAwMDY1NDM0MzE5OXxUNDl3M0Jxb1pVZWd5cHJ1NTFHcmE3MGhFRDgiLCJ1c2VyIjp7ImNvdW50cnkiOiJkZSIsImxvY2FsZSI6ImVuX1VTIiwiYWdlIjp7Im1pbiI6MjF9fSwidXNlcl9pZCI6IjEwMDAwMDY1NDM0MzE5OSJ9"
|
13
13
|
@invalid_request_2 = "vl0p_bGyDeVZ2I21cJvLd5C9CwpMkU2mcp1eUGWdvWs.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImV4cGlyZXMiOjEzMDg5ODg4MDAsImlzc3VlZF9hdCI6MTMwODk4NTAxOCwib2F1dGhfdG9rZW4iOiIxMTQ5NTIyOTg1OTM4MTN8Mi5BUUJBdHRSbExWbndxTlBaLjM2MDAuMTMwODk4ODgwMC4xLTEwMDAwMDY1NDM0MzE5OXxUNDl3M0Jxb1pVZWd5cH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