rack-jsonr 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/rack/jsonr/jsonr.rb +2 -1
- data/lib/rack/jsonr/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGUyYWViYzE3MTQyODgwMTBhYWEzMDZkYTdmZGIxNmUzOTRkYmI3ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTMxYTMwZmEyYTU2ZjcxMjYzNjVhMDNhODU4ZGQ5MzI0MGI5ODZiNQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzQ1Mjc0M2ViZDI4ZWRjNmFhYzBmZTgyY2VhNWZkZjc5MDVlMTU4NjM1Mjcx
|
10
|
+
YmMyNTQxNTc0MTk4ZjMyMDkyNTRmODRkYjNiZDZjMmMzNmYwOTE5YjUyYmE3
|
11
|
+
MzcyY2Q0YzQ1MGM2ZThmNmZlMDc3OWE5OGYxOTYyNTIzZDY1ZGM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OWUxNzQxOGI3NGI1MmMzN2M2MDRiMGM5OTg0YzAyNWU5NjJlYTIzMzg2ZGRi
|
14
|
+
OWUxYzNiNDMzOTNjNzk2MTU2ZjBmYWYzNTFlZDA4ZjhjMjQ0YjlmMzc3ZWM1
|
15
|
+
ZWNkZmExYjYyMTBhYjgyOGFlMmVmODMxNTgyMDkxY2QwMTc1ZjU=
|
data/lib/rack/jsonr/jsonr.rb
CHANGED
@@ -74,7 +74,8 @@ module Rack
|
|
74
74
|
def format_jsonp(callback, status, headers, response, x_headers={}, body='')
|
75
75
|
headers.each {|k,v| x_headers[k] = v if (k =~ /^X-.+/i) }
|
76
76
|
response.each {|v| body << v.to_s }
|
77
|
-
|
77
|
+
body = 'null' if body.nil? or body == ''
|
78
|
+
["#{callback}(#{body}, #{status}, #{x_headers.to_json})"]
|
78
79
|
end
|
79
80
|
|
80
81
|
end
|
data/lib/rack/jsonr/version.rb
CHANGED