rack-jsonr 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmVhODZiYzRmZDAxYTE3YTYxNDU5NTYyMjMwZDI1OTVmZTEwNmU5Zg==
4
+ MzFjZjg3ZjY1MjkxODRmZjdlMDhmMzRjMDg5OGIzZTM0ZWI4ODI1YQ==
5
5
  data.tar.gz: !binary |-
6
- OTAwNmRlNTMyY2E2OGU5NDcwMGRhYjVjY2UzYzNlMDhiZWU0ZDEzNA==
6
+ ZDkzZGNmOWJlMWExMmUwNzRmMWUyZjMxYjRhMDc1NjIyNzg3NTc4Nw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Mzc1ZDIzNjkyYmQ5YmFmNGY1ZTc5NmNmZjJkZTc4YzFiNmZjZjk2ZjllMzYz
10
- OWI0MWRjNWZjYzlkMTQ4M2JmNDlhODY0MWFiODA0M2FiNDk2MjU4MjkwMzBj
11
- N2E3MzljYzIzNTJmMmQwODZjZDM3NmJiZTdkYjAwNjgyZWQ3NTU=
9
+ ZDBjZWFhZGQxMmI1OTk2ODVkOWQ4Y2MwMmJhZWYxODRmNTQxZWI0MWQzM2My
10
+ YTM4Njc0ZDFhZjQwNDk3OGJlNDE4NDViZDZmNzA1MDQ0YTgyMmQ5MDkwMjU5
11
+ ODU4Yjk3YzgwMTE1NWMwZWRlMjY4ZjM3NjlkMDQ4ZTNkYzU1N2Q=
12
12
  data.tar.gz: !binary |-
13
- ZGYxYWIzZDE5MTBmYWVjYzE2MjVmMTY3MGM5ZjFhMWViN2FmOGE0MzQzYWIy
14
- YjA5N2M4ZDQ5NjRhZWJkNWU5NTRlMTVhZmI3YmMyMjUzOGViOTYxNmE1M2Rk
15
- OWY2YzY5NGVjZmJjZGJlMDI4NjRlOGUyOWNhYzBlYzg1ODg1ZTI=
13
+ OTAyMGQxYmNhY2I0MTM5MDlmNWQzNTIwZjRlMDU2NDEyNzAxYmRjNmNkMjRh
14
+ ZDMyZmQ4MTUzYTY5MWYyN2E1MGRiMGVlNWFiODczN2U0ZWQ1NzE3Y2JlOWJh
15
+ MDQ5MGQ2YjRiMDk3YTNlNTk5MTE3NjM0YzAyODEwZTM5ZGYzYjg=
@@ -27,13 +27,10 @@ module Rack
27
27
  params = request.params
28
28
 
29
29
  if is_jsonp_request?(request)
30
- env['IS_REQUESTING_JSONP'] = true
31
30
  env['REQUEST_METHOD'] = params['request_method'].upcase if params['request_method'] and ['POST','PUT','DELETE'].include?(params['request_method'].upcase)
32
- else
33
- env['IS_REQUESTING_JSONP'] = false
34
31
  end
35
32
 
36
- if is_jsonp_request?(request) and is_json_response?(headers)
33
+ if is_jsonp_request?(request) #and is_json_response?(headers)
37
34
  response = format_jsonp(request.params.delete('callback'), status, headers, response)
38
35
  status = 200
39
36
 
@@ -56,7 +53,11 @@ module Rack
56
53
  end
57
54
 
58
55
  def is_jsonp_request?(request)
59
- @is_jsonp_request ||= (request.params.include?('callback') and request.get?)
56
+ @is_jsonp_request ||= self.class.is_jsonp_request?(request)
57
+ end
58
+
59
+ def self.is_jsonp_request?(request)
60
+ (request.params.include?('callback') and request.get?)
60
61
  end
61
62
 
62
63
  # Formats the JSONP padding to include body, headers and http status
@@ -1,3 +1,3 @@
1
1
  class Rack::JSONR
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-jsonr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Clark