pagelet_rails 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2d8404207e91426757183b16f97661eac4922f1
4
- data.tar.gz: 3190702de9185c7d63a6bf7e4c51b29a510d2ce4
3
+ metadata.gz: ce0e29cccaa2bbb2df0f627d3f6384d5e9646dce
4
+ data.tar.gz: 4e685ae8f50137fffed19940a7801468c2b59f8d
5
5
  SHA512:
6
- metadata.gz: 96221786802a467fcd81327c848d2c61ed9bd771bf5fa58c665e0f9186b8408424ebfd1056aa58986f30f548a991a52e72c369959ede486c259b4514880565d4
7
- data.tar.gz: 47a9f3d61fdf2e38ce9535094e7962eb572fde9e9beca8f2e5bee879c48a9d745e1fb50b4a31202632232ef8ea3e1e4403d16d4c1113e6a873d2ac18eab5c48f
6
+ metadata.gz: df451c73ea6f88a1ea2ae7cc0956afaae34591a0d610e52024dfe73be726b94b41e20c21c3a38ebb5a14f9395f145cf6bc79206f3baaec574b64f431b8932be5
7
+ data.tar.gz: 044fee3287b458a9f4385119a0ee7fe6656ab0bd927b707a8216d9920031e27e2d0dcb2fdf704e223bede0ae4899815cd121c61030d017bba8b7e294d147e957
@@ -76,15 +76,24 @@ module PageletsHelper
76
76
  c.pagelet_options p_options
77
77
  c.pagelet_options original_options: p_options
78
78
 
79
- env = Rack::MockRequest.env_for(path,
80
- 'REMOTE_ADDR' => request.env['REMOTE_ADDR'],
81
- 'HTTP_HOST' => request.env['HTTP_HOST'],
82
- 'HTTP_TURBOLINKS_REFERRER' => request.env['HTTP_TURBOLINKS_REFERRER'],
83
- 'HTTP_USER_AGENT' => request.env['HTTP_USER_AGENT'],
84
- 'HTTP_X_CSRF_TOKEN' => request.env['HTTP_X_CSRF_TOKEN'],
85
- 'HTTP_X_PAGELET' => request.env['HTTP_X_PAGELET'],
86
- 'HTTP_X_REQUESTED_WITH' => "XMLHttpRequest",
87
- )
79
+ env = request.env.select do |key, value|
80
+ case key.to_s
81
+ when /^action_dispatch\.request/i,
82
+ /^action_controller/i,
83
+ /^rack\.request/i,
84
+ /^request/i,
85
+ 'HTTP_ACCEPT',
86
+ 'CONTENT_TYPE',
87
+ 'CONTENT_LENGTH',
88
+ 'REQUEST_METHOD'
89
+ false
90
+ else
91
+ true
92
+ end
93
+ end
94
+
95
+ env['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest"
96
+ env = Rack::MockRequest.env_for(path, env)
88
97
 
89
98
  p_request = ActionDispatch::Request.new(env)
90
99
  p_request.parameters.clear
@@ -1,3 +1,3 @@
1
1
  module PageletRails
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagelet_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Katunin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-08 00:00:00.000000000 Z
11
+ date: 2016-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails