nexpose 3.0.0 → 3.0.1

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: 655abc9506b7d35e2b0d09097a40fe2cd1be8957
4
- data.tar.gz: 47dd93d3c38ab7d6834ec2f905ce41bf8644ddb4
3
+ metadata.gz: 70c4f4ef8d091956dabc195132a8e03576941c1f
4
+ data.tar.gz: 1026e14754b114bec2c0195d4aa0d0e8d1be1e80
5
5
  SHA512:
6
- metadata.gz: da349fdd82a17c6df04d4321b3ace9d10dab2fc49d3d2dfe614de2dbf4caa22f40e50f8a7102a199d81acff5a4e6409fae7fea59d1fdf0883567c75127e5e9d9
7
- data.tar.gz: b879628ea4cc24feb49f35d5ed99d42c4f3e515dbd2eae6cedb21024bd2723de4236288db913c8daeb486f0d21c74a7b77527237e96c93ae13a595979426e528
6
+ metadata.gz: cd109c671af57fca71f584e99604f4c81bbfbe5bac8f15981542e7a0398e28c53438d057380f80eef2bb4cb91158033a45b5a763f7e3588a3867415657aad367
7
+ data.tar.gz: 0ce383fa6a43b85dcc0550751b442462ee5ef415abe01ed48d96f64cccf2c45778c85bef5b895995d6cb0afecf2a89bbfb7e6a9bffcabdc9a6857bce8eefe422
data/lib/nexpose/ajax.rb CHANGED
@@ -187,12 +187,21 @@ module Nexpose
187
187
  # is 2.1 or greater otherwise use the request body
188
188
  def get_error_message(request, response)
189
189
  version = get_request_api_version(request)
190
- data_request = request.path.include? '/data/'
191
- data_request ? response_is_text = (response.content_type.include? 'text/plain') : nil
192
- return_response = (version >= 2.1 || (data_request && response_is_text))
190
+ data_request = use_response_error_message?(request, response)
191
+ return_response = (version >= 2.1 || data_request )
193
192
  (return_response && response.body) ? "response body: #{response.body}" : "request body: #{request.body}"
194
193
  end
195
194
 
195
+ # Code cleanup to allow for cleaner get_error_message method
196
+ #
197
+ def use_response_error_message?(request, response)
198
+ if (request.path.include?('/data/') && !response.content_type.nil?)
199
+ response.content_type.include? 'text/plain'
200
+ else
201
+ return false
202
+ end
203
+ end
204
+
196
205
  # Execute a block of code while presenving the preferences for any
197
206
  # underlying table being accessed. Use this method when accessing data
198
207
  # tables which are present in the UI to prevent existing row preferences
@@ -1,4 +1,4 @@
1
1
  module Nexpose
2
2
  # The latest version of the Nexpose gem
3
- VERSION = '3.0.0'
3
+ VERSION = '3.0.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexpose
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - HD Moore