chespirito 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c26d5cfd95f22fdb7fa89e0f16c36cc551f757c4009c42dbd36c95798f27c252
4
- data.tar.gz: '09c340a8e1776bf4d33e578ba6475110d84703d2c5a0fc79b3bfff6f45859a75'
3
+ metadata.gz: 20fa9bd6c4f6ac083d413dad7a922c742828b085c279dc87158298e993e70c4c
4
+ data.tar.gz: e28284cf6523b591d37963dcc19a8991b8be5bbb36390c2d10b068d55a219768
5
5
  SHA512:
6
- metadata.gz: 75895b71b94768410da2bae31f1969dc7fde2b374c6d45ca9128049b97d7b3571163fe56ebb3f54a36f0f6c0b38cd178d9157dbba71abe403a30e8eeeb9c24d7
7
- data.tar.gz: 21684e74e4478c61fe5f56b85c4a31d72e95489fb5a3ebb68a19cada1e46dca52b89e1aac2502632d15b85494cb66e6cc57b769196fe1b01f5649bfb2ea98617
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.4'
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']
@@ -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['Content-Type']) : {}
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, content_type)
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'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chespirito
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Proença