cryx-g5k 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/g5k/rack/jsonp.rb +8 -3
  3. metadata +2 -2
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 2
3
- :patch: 8
3
+ :patch: 9
4
4
  :major: 0
@@ -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
- status, headers, response = @app.call(env)
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
- if request.params.include?('callback')
22
- response = pad(request.params.delete('callback'), response)
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.8
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-24 00:00:00 -07:00
12
+ date: 2009-03-25 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15