zuora_api 1.11.1 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/zuora_api/login.rb +20 -20
- data/lib/zuora_api/logins/oauth.rb +1 -1
- data/lib/zuora_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1377cfe445b9ff82e0504e86ef89413c815b4250152769ec11bf6b7b8804cdd9
|
4
|
+
data.tar.gz: 9882ca98957ecf177985037124f9e77722fe9c1eeea430f8c5f632fc4327162c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5043d898c8ec80517f01bd65daf031880aa4ab91e14669eedece02be8dab5c7b895abeb8d48330c89a9159875f8a9418adb2db2b3017bfe5b698100bb3035183
|
7
|
+
data.tar.gz: 85ca8f78f0807ed8c7533e612a0816dcbdf52ec71131c1c122cc110e89898c0dfbe69d560e5130e50f438bced5235331ee4590af12912248319bddfae52cc376
|
data/lib/zuora_api/login.rb
CHANGED
@@ -904,6 +904,8 @@ module ZuoraAPI
|
|
904
904
|
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new(error_message, response)
|
905
905
|
when /414 Request-URI Too Large/
|
906
906
|
raise ZuoraAPI::Exceptions::ZuoraAPIError.new("Request URL is too long", response)
|
907
|
+
when /Not Found/
|
908
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIError.new("The page you were looking for could not be found. If you believe you reached this page in error, please email support.", response)
|
907
909
|
else
|
908
910
|
raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new(error_message, response)
|
909
911
|
end
|
@@ -1339,11 +1341,7 @@ module ZuoraAPI
|
|
1339
1341
|
status_code = response.code if response
|
1340
1342
|
case response
|
1341
1343
|
when Net::HTTPOK
|
1342
|
-
|
1343
|
-
response.each_header do |k,v|
|
1344
|
-
headers[k] = v
|
1345
|
-
end
|
1346
|
-
Rails.logger.debug("Headers: #{headers.to_s}")
|
1344
|
+
Rails.logger.warn("Headers: #{response.to_hash.to_s}")
|
1347
1345
|
if output_file_name.present?
|
1348
1346
|
file_ending ||= output_file_name.end_with?(".csv.zip") ? ".csv.zip" : File.extname(output_file_name)
|
1349
1347
|
filename ||= File.basename(output_file_name, file_ending)
|
@@ -1351,15 +1349,16 @@ module ZuoraAPI
|
|
1351
1349
|
|
1352
1350
|
size, export_progress = [0, 0]
|
1353
1351
|
encoding, type, full_filename = [nil, nil, nil]
|
1354
|
-
if response.
|
1355
|
-
|
1352
|
+
if response.get_fields("Content-Disposition").present?
|
1353
|
+
content_disposition = response.get_fields("Content-Disposition")[0]
|
1354
|
+
case content_disposition
|
1356
1355
|
when /.*; filename\*=.*/
|
1357
|
-
full_filename ||= /.*; filename\*=(.*)''(.*)/.match(
|
1358
|
-
encoding = /.*; filename\*=(.*)''(.*)/.match(
|
1356
|
+
full_filename ||= /.*; filename\*=(.*)''(.*)/.match(content_disposition)[2].strip
|
1357
|
+
encoding = /.*; filename\*=(.*)''(.*)/.match(content_disposition)[1].strip
|
1359
1358
|
when /.*; filename=/
|
1360
|
-
full_filename ||= /.*; filename=(.*)/.match(
|
1359
|
+
full_filename ||= /.*; filename=(.*)/.match(content_disposition)[1].strip
|
1361
1360
|
else
|
1362
|
-
raise "Can't parse Content-Disposition header: #{
|
1361
|
+
raise "Can't parse Content-Disposition header: #{content_disposition}"
|
1363
1362
|
end
|
1364
1363
|
file_ending ||= full_filename.end_with?(".csv.zip") ? ".csv.zip" : File.extname(full_filename)
|
1365
1364
|
filename ||= File.basename(full_filename, file_ending)
|
@@ -1369,21 +1368,22 @@ module ZuoraAPI
|
|
1369
1368
|
file_ending ||= uri.path.end_with?(".csv.zip") ? ".csv.zip" : File.extname(uri.path)
|
1370
1369
|
filename ||= File.basename(uri.path, file_ending)
|
1371
1370
|
|
1372
|
-
if response.
|
1373
|
-
|
1371
|
+
if response.get_fields("Content-Type").present?
|
1372
|
+
content_type = response.get_fields("Content-Type")[0]
|
1373
|
+
case content_type
|
1374
1374
|
when /.*;charset=.*/
|
1375
|
-
type = /(.*);charset=(.*)/.match(
|
1376
|
-
encoding = /(.*);charset=(.*)/.match(
|
1375
|
+
type = /(.*);charset=(.*)/.match(content_type)[1]
|
1376
|
+
encoding = /(.*);charset=(.*)/.match(content_type)[2]
|
1377
1377
|
else
|
1378
|
-
type =
|
1378
|
+
type = content_type
|
1379
1379
|
encoding ||= 'UTF-8'
|
1380
1380
|
end
|
1381
1381
|
end
|
1382
1382
|
|
1383
|
-
if response.
|
1384
|
-
export_size = response.
|
1385
|
-
elsif response.
|
1386
|
-
export_size = response.
|
1383
|
+
if response.get_fields("Content-Length").present?
|
1384
|
+
export_size = response.get_fields("Content-Length")[0].to_i
|
1385
|
+
elsif response.get_fields("ContentLength").present?
|
1386
|
+
export_size = response.get_fields("ContentLength")[0].to_i
|
1387
1387
|
end
|
1388
1388
|
|
1389
1389
|
Rails.logger.info("File: #{filename}#{file_ending} #{encoding} #{type} #{export_size}")
|
@@ -53,7 +53,7 @@ module ZuoraAPI
|
|
53
53
|
def get_bearer_token(zuora_track_id: nil)
|
54
54
|
raise ZuoraAPI::Exceptions::ZuoraAPIAuthenticationTypeError.new("Request Oauth Login but either 'Oauth Client Id' or 'Oauth Secret' were not passed") if self.oauth_client_id.blank? || self.oauth_secret.blank?
|
55
55
|
|
56
|
-
headers = {
|
56
|
+
headers = {"Content-Type" => "application/x-www-form-urlencoded" }
|
57
57
|
headers['Zuora-Track-Id'] = zuora_track_id if zuora_track_id.present?
|
58
58
|
headers['X-Amzn-Trace-Id'] = zuora_track_id if zuora_track_id.present?
|
59
59
|
|
data/lib/zuora_api/version.rb
CHANGED