|
102 | 102 | Faraday::Adapter::Test::Stubs.new do |stub| |
103 | 103 | stub.post("https://auth.example.com/oauth2/token") do |env| |
104 | 104 | id_and_secret = "#{client_id}:#{client_secret}" |
105 | | - basic_auth = "Basic #{Base64.urlsafe_encode64(id_and_secret)}" |
| 105 | + basic_auth = "Basic #{Base64.strict_encode64(id_and_secret)}" |
106 | 106 | fail "Basic Authorization is missing." unless env.request_headers["Authorization"] == basic_auth |
107 | 107 | [200, {"Content-Type" => "application/json"}, response_payload.to_json] |
108 | 108 | end |
|
204 | 204 | Faraday::Adapter::Test::Stubs.new do |stub| |
205 | 205 | stub.post("https://auth.example.com/oauth2/token", params_matcher) do |env| |
206 | 206 | id_and_secret = "#{client_id}:#{client_secret}" |
207 | | - basic_auth = "Basic #{Base64.urlsafe_encode64(id_and_secret)}" |
| 207 | + basic_auth = "Basic #{Base64.strict_encode64(id_and_secret)}" |
208 | 208 | fail "Basic Authorization is missing." unless env.request_headers["Authorization"] == basic_auth |
209 | 209 | [200, {"Content-Type" => "application/json"}, response_payload.to_json] |
210 | 210 | end |
|
325 | 325 | Faraday::Adapter::Test::Stubs.new do |stub| |
326 | 326 | stub.post("https://auth.example.com/oauth2/token") do |env| |
327 | 327 | id_and_secret = "#{client_id}:#{client_secret}" |
328 | | - basic_auth = "Basic #{Base64.urlsafe_encode64(id_and_secret)}" |
| 328 | + basic_auth = "Basic #{Base64.strict_encode64(id_and_secret)}" |
329 | 329 | fail "Basic Authorization is missing." unless env.request_headers["Authorization"] == basic_auth |
330 | 330 | [200, {"Content-Type" => "application/json"}, response_payload.to_json] |
331 | 331 | end |
|
373 | 373 | Faraday::Adapter::Test::Stubs.new do |stub| |
374 | 374 | stub.post("https://auth.example.com/oauth2/token", params_matcher) do |env| |
375 | 375 | id_and_secret = "#{client_id}:#{client_secret}" |
376 | | - basic_auth = "Basic #{Base64.urlsafe_encode64(id_and_secret)}" |
| 376 | + basic_auth = "Basic #{Base64.strict_encode64(id_and_secret)}" |
377 | 377 | fail "Basic Authorization is missing." unless env.request_headers["Authorization"] == basic_auth |
378 | 378 | [200, {"Content-Type" => "application/json"}, response_payload.to_json] |
379 | 379 | end |
|
0 commit comments