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 +4 -4
- data/lib/nexpose/ajax.rb +12 -3
- data/lib/nexpose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70c4f4ef8d091956dabc195132a8e03576941c1f
|
4
|
+
data.tar.gz: 1026e14754b114bec2c0195d4aa0d0e8d1be1e80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
191
|
-
|
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
|
data/lib/nexpose/version.rb
CHANGED