rack-post-body-to-params 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -84,13 +84,17 @@ module Rack
84
84
 
85
85
  if @content_types.include? content_type
86
86
  post_body = env[POST_BODY].read
87
- begin
88
- new_form_hash = parsers[content_type].call post_body
89
- rescue Exception => error
90
- logger.warn "#{self.class} #{content_type} parsing error: #{error.to_s}" if respond_to? :logger
91
- return error_responses[content_type].call error
87
+
88
+ unless post_body.blank?
89
+ begin
90
+ new_form_hash = parsers[content_type].call post_body
91
+ rescue Exception => error
92
+ logger.warn "#{self.class} #{content_type} parsing error: #{error.to_s}" if respond_to? :logger
93
+ return error_responses[content_type].call error
94
+ end
95
+ env.update(FORM_HASH => new_form_hash, FORM_INPUT => env[POST_BODY])
92
96
  end
93
- env.update(FORM_HASH => new_form_hash, FORM_INPUT => env[POST_BODY])
97
+
94
98
  end
95
99
 
96
100
  @app.call(env)
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rack-post-body-to-params}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Niko Dittmann"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-post-body-to-params
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Niko Dittmann