From 8450627f053c961d8777a7e7445435af770eb443 Mon Sep 17 00:00:00 2001 From: Sanchit Kashyap Date: Fri, 22 Nov 2019 10:13:47 +0530 Subject: [PATCH] url encode properties (#57) --- lib/presto/client/faraday_client.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/presto/client/faraday_client.rb b/lib/presto/client/faraday_client.rb index 05dd701e..a1aa5b59 100644 --- a/lib/presto/client/faraday_client.rb +++ b/lib/presto/client/faraday_client.rb @@ -15,6 +15,8 @@ # module Presto::Client + require 'cgi' + module PrestoHeaders PRESTO_USER = "X-Presto-User" PRESTO_SOURCE = "X-Presto-Source" @@ -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