Skip to content

Commit

Permalink
url encode properties (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchitkashyap authored and Lewuathe committed Nov 22, 2019
1 parent f7e9973 commit 8450627
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/presto/client/faraday_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#
module Presto::Client

require 'cgi'

module PrestoHeaders
PRESTO_USER = "X-Presto-User"
PRESTO_SOURCE = "X-Presto-Source"
Expand Down Expand Up @@ -155,6 +157,7 @@ def self.encode_properties(properties)
if field_value =~ HTTP11_CTL_CHARSET_REGEXP
raise Faraday::ClientError, "Value of properties can't include HTTP/1.1 control characters"
end
field_value = CGI.escape(field_value)
"#{token}=#{field_value}"
end
end
Expand Down

0 comments on commit 8450627

Please sign in to comment.