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 +1 -1
- data/lib/rack/rpc/endpoint/jsonrpc.rb +4 -2
- data/lib/rack/rpc/endpoint/xmlrpc.rb +3 -1
- data/lib/rack/rpc/version.rb +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
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
|
-
|
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
|
-
# @
|
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
|
-
|
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
|
data/lib/rack/rpc/version.rb
CHANGED