diff --git a/lib/net/http/header.rb b/lib/net/http/header.rb index a39043e..a597182 100644 --- a/lib/net/http/header.rb +++ b/lib/net/http/header.rb @@ -964,13 +964,13 @@ def set_form_data(params, sep = '&') # Field names and values of non-file fields should be encoded with this charset. # def set_form(params, enctype='application/x-www-form-urlencoded', formopt={}) - @body_data = params - @body = nil - @body_stream = nil - @form_option = formopt case enctype when /\Aapplication\/x-www-form-urlencoded\z/i, /\Amultipart\/form-data\z/i + @body_data = params + @body = nil + @body_stream = nil + @form_option = formopt self.content_type = enctype else raise ArgumentError, "invalid enctype: #{enctype}"