Change query character to ampersand if the license_info_url contains an question mark.

This commit is contained in:
Arjen van Bochoven
2013-10-21 20:43:09 +02:00
parent 536696b004
commit fcb7181830
+3 -1
View File
@@ -1603,12 +1603,14 @@ def updateAvailableLicenseSeats(installinfo):
# complicated logic here to 'batch' process our GET requests but
# keep them under 256 characters each
start_index = 0
# Use ampersand when the license_info_url contains a ?
q_char = ('&', '?')[license_info_url.find('?') == -1]
while start_index < len(items_to_check):
end_index = len(items_to_check)
while True:
query_items = ['name=' + quote_plus(item)
for item in items_to_check[start_index:end_index]]
querystring = '?' + '&'.join(query_items)
querystring = q_char + '&'.join(query_items)
url = license_info_url + querystring
if len(url) < 256:
break