Skip to content

Commit fe57b9d

Browse files
committed
Landing rapid7#1784 - Handles nils in params
Nils are handled by converting values into strings
2 parents 9e78858 + 6bf19c6 commit fe57b9d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/rex/proto/http/client_request.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ def to_s
111111
end
112112

113113
opts['vars_get'].each_pair do |var,val|
114+
var = var.to_s
115+
val = val.to_s
116+
114117
qstr << '&' if qstr.length > 0
115118
qstr << (opts['encode_params'] ? set_encode_uri(var) : var)
116119
qstr << '='
@@ -129,6 +132,9 @@ def to_s
129132
end
130133

131134
opts['vars_post'].each_pair do |var,val|
135+
var = var.to_s
136+
val = val.to_s
137+
132138
pstr << '&' if pstr.length > 0
133139
pstr << (opts['encode_params'] ? set_encode_uri(var) : var)
134140
pstr << '='
@@ -220,7 +226,7 @@ def set_uri
220226
end
221227

222228
def set_encode_uri(str)
223-
a = str.dup
229+
a = str.to_s.dup
224230
opts['uri_encode_count'].times {
225231
a = Rex::Text.uri_encode(a, opts['uri_encode_mode'])
226232
}

0 commit comments

Comments
 (0)