rack-rpc 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -22,7 +22,9 @@ class Rack::RPC::Endpoint
22
22
  # @param [Rack::Request] request
23
23
  # @return [Rack::Response]
24
24
  def execute(request)
25
- Rack::Response.new([process(request.body.read)], 200, {
25
+ request_body = request.body.read
26
+ request_body.force_encoding(Encoding::UTF_8) if request_body.respond_to?(:force_encoding) # Ruby 1.9+
27
+ Rack::Response.new([process(request_body)], 200, {
26
28
  'Content-Type' => (request.content_type || CONTENT_TYPE).to_s,
27
29
  })
28
30
  end
@@ -81,7 +83,7 @@ class Rack::RPC::Endpoint
81
83
  OPTIONS = {}
82
84
 
83
85
  ##
84
- # @parse [String] input
86
+ # @param [String] input
85
87
  # @return [Object]
86
88
  def self.parse(input)
87
89
  self.new(JSON.parse(input))
@@ -31,7 +31,9 @@ class Rack::RPC::Endpoint
31
31
  # @param [Rack::Request] request
32
32
  # @return [Rack::Response]
33
33
  def execute(request)
34
- Rack::Response.new([process(request.body.read)], 200, {
34
+ request_body = request.body.read
35
+ request_body.force_encoding(Encoding::UTF_8) if request_body.respond_to?(:force_encoding) # Ruby 1.9+
36
+ Rack::Response.new([process(request_body)], 200, {
35
37
  'Content-Type' => (request.content_type || CONTENT_TYPE).to_s,
36
38
  })
37
39
  end
@@ -2,7 +2,7 @@ module Rack; module RPC
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 1
5
+ TINY = 2
6
6
  EXTRA = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, EXTRA].compact.join('.')
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Datagraph