cryx-g5k 0.2.8 → 0.2.9
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.
- data/VERSION.yml +1 -1
- data/lib/g5k/rack/jsonp.rb +8 -3
- metadata +2 -2
data/VERSION.yml
CHANGED
data/lib/g5k/rack/jsonp.rb
CHANGED
@@ -16,10 +16,15 @@ module Rack
|
|
16
16
|
# Changes nothing if no <tt>callback</tt> param is specified.
|
17
17
|
#
|
18
18
|
def call(env)
|
19
|
-
|
19
|
+
# remove the callback and _ parameters BEFORE calling the backend,
|
20
|
+
# so that caching middleware does not store a copy for each value of the callback parameter
|
20
21
|
request = Rack::Request.new(env)
|
21
|
-
|
22
|
-
|
22
|
+
callback = request.params.delete('callback')
|
23
|
+
env['QUERY_STRING'] = env['QUERY_STRING'].split("&").delete_if{|param| param =~ /^(_|callback)/}.join("&")
|
24
|
+
|
25
|
+
status, headers, response = @app.call(env)
|
26
|
+
if callback
|
27
|
+
response = pad(callback, response)
|
23
28
|
headers['Content-Length'] = response.length.to_s
|
24
29
|
end
|
25
30
|
[status, headers, response]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cryx-g5k
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Rohr
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-03-
|
12
|
+
date: 2009-03-25 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|