Skip to content

Commit

Permalink
Merge pull request #283 from wtcross/master
Browse files Browse the repository at this point in the history
Use Base64.strict_encode64 instead of Base64.encode64.
  • Loading branch information
igrigorik committed Mar 26, 2015
2 parents 03dbba9 + 9f5665e commit 7b8d47c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/em-http/http_encoding.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def encode_field(k, v)
# String - custom auth string (OAuth, etc)
def encode_auth(k,v)
if v.is_a? Array
FIELD_ENCODING % [k, ["Basic", Base64.encode64(v.join(":")).split.join].join(" ")]
FIELD_ENCODING % [k, ["Basic", Base64.strict_encode64(v.join(":")).split.join].join(" ")]
else
encode_field(k,v)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/stallion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def self.call(env)
stable.response.status = 200
stable.response.write stable.request.env["HTTP_AUTHORIZATION"]
elsif stable.request.path_info == '/authtest'
auth = "Basic %s" % Base64.encode64(['user', 'pass'].join(':')).split.join
auth = "Basic %s" % Base64.strict_encode64(['user', 'pass'].join(':')).split.join
if auth == stable.request.env["HTTP_AUTHORIZATION"]
stable.response.status = 200
stable.response.write 'success'
Expand Down

0 comments on commit 7b8d47c

Please sign in to comment.