chespirito 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/chespirito.gemspec +1 -1
- data/lib/chespirito/request.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20fa9bd6c4f6ac083d413dad7a922c742828b085c279dc87158298e993e70c4c
|
4
|
+
data.tar.gz: e28284cf6523b591d37963dcc19a8991b8be5bbb36390c2d10b068d55a219768
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fba07ce5f4fde7a1d1fd50e03b40c966a9b8d1101579c6f698ffd2ec604675c7b731cf10fc0055ca07704e595ef51ca8a5c6b86461c0c3f8919254b648cda481
|
7
|
+
data.tar.gz: bb87273a7c007c59d1ae5de8997cb561e6fa251d119c3901b61b8c5bb221ded915cd81f505a45757c1dfda15cb8aa9c914217336dafd7b41d2e043dffb6e4ebd
|
data/chespirito.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'chespirito'
|
5
|
-
spec.version = '0.0.
|
5
|
+
spec.version = '0.0.5'
|
6
6
|
spec.summary = 'Chespirito Ruby web framework'
|
7
7
|
spec.description = 'A dead simple, yet Rack-compatible, web framework written in Ruby'
|
8
8
|
spec.authors = ['Leandro Proença']
|
data/lib/chespirito/request.rb
CHANGED
@@ -21,7 +21,7 @@ module Chespirito
|
|
21
21
|
rack_request = Rack::Request.new(env)
|
22
22
|
|
23
23
|
body_params = rack_request.post? ? parse_body_params(rack_request.body.read,
|
24
|
-
rack_request.env
|
24
|
+
rack_request.env) : {}
|
25
25
|
|
26
26
|
params = rack_request.params.merge(body_params)
|
27
27
|
|
@@ -34,7 +34,9 @@ module Chespirito
|
|
34
34
|
)
|
35
35
|
end
|
36
36
|
|
37
|
-
def self.parse_body_params(body_data,
|
37
|
+
def self.parse_body_params(body_data, request_env)
|
38
|
+
content_type = request_env['Content-Type'] || request_env['content-type']
|
39
|
+
|
38
40
|
case content_type
|
39
41
|
in 'application/json'; JSON.parse(body_data)
|
40
42
|
in 'application/x-www-form-urlencoded'
|