rack-contrib 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rack-contrib might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/rack/contrib/post_body_content_type_parser.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3cea264a3b11a9fbb1007dffe003812fd158e17
|
4
|
+
data.tar.gz: 2ea55db6bc8035033498a3ef28eaf67a05e77d0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47ec0e780cc7f17442a259ca705f2f4195b697deea6a9846ff37444823306b2f713bf4f5b15ed646a2cdab4f18a367cca8a703d4691645507b2f4d91f423cd6d
|
7
|
+
data.tar.gz: 157cd41a8ba74f5872f7f4dae46c0234b2aea03babbe984d3c4278e1f9b78b466cd5341ff7602be217015234b62ea3a050a0e458f67369dd76e5a98c69c8fd44
|
@@ -34,7 +34,12 @@ module Rack
|
|
34
34
|
env.update(FORM_HASH => JSON.parse(body, :create_additions => false), FORM_INPUT => env[POST_BODY])
|
35
35
|
end
|
36
36
|
@app.call(env)
|
37
|
+
rescue JSON::ParserError
|
38
|
+
bad_request('failed to parse body as JSON')
|
37
39
|
end
|
38
40
|
|
41
|
+
def bad_request(body = 'Bad Request')
|
42
|
+
[ 400, { 'Content-Type' => 'text/plain', 'Content-Length' => body.size.to_s }, [body] ]
|
43
|
+
end
|
39
44
|
end
|
40
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-contrib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rack-devel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|