comparison roundup/rest.py @ 5616:aa4c271514ae

Original code generated url's using a harcoded protocol and took the hostname from the hostname used to access the tracker. This patch uses the canonical path from config.ini for generating all links.
author John Rouillard <rouilj@ieee.org>
date Sat, 16 Feb 2019 15:24:53 -0500
parents ed02a1e0aa5d
children 38b7c4693d9a
comparison
equal deleted inserted replaced
5615:14e176b5cd90 5616:aa4c271514ae
247 # would include too many actions that do not make sense in the 247 # would include too many actions that do not make sense in the
248 # REST-API context, so for now we only permit the retire and 248 # REST-API context, so for now we only permit the retire and
249 # restore actions. 249 # restore actions.
250 self.actions = dict (retire = actions.Retire, restore = actions.Restore) 250 self.actions = dict (retire = actions.Retire, restore = actions.Restore)
251 251
252 protocol = 'http' 252 # note TRACKER_WEB ends in a /
253 host = self.client.env['HTTP_HOST'] 253 self.base_path = '%srest' % (self.db.config.TRACKER_WEB)
254 tracker = self.client.env['TRACKER_NAME']
255 self.base_path = '%s://%s/%s/rest' % (protocol, host, tracker)
256 self.data_path = self.base_path + '/data' 254 self.data_path = self.base_path + '/data'
257 255
258 def props_from_args(self, cl, args, itemid=None): 256 def props_from_args(self, cl, args, itemid=None):
259 """Construct a list of properties from the given arguments, 257 """Construct a list of properties from the given arguments,
260 and return them after validation. 258 and return them after validation.

Roundup Issue Tracker: http://roundup-tracker.org/