Skip to content

Commit 7067f74

Browse files
committed
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.
1 parent a6b7ce7 commit 7067f74

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ Features:
4343
other than GET that doesn't have a payload. E.G. DELETE, PATCH or
4444
OPTIONS. Verbs like PUT and POST usually have payloads, so this
4545
patch doesn't touch processing of these methods. (John Rouillard)
46+
- Patches to new rest code:
47+
- Generated links in responses should use the base url specified
48+
in config.ini.
49+
(John Rouillard)
4650
- issue2550833: the export_csv web action now returns labels/names
4751
rather than id's. Replace calls to export_csv with the export_csv_id
4852
action to return the same data as the old export_csv action. (Tom

roundup/rest.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,8 @@ def __init__(self, client, db):
249249
# restore actions.
250250
self.actions = dict (retire = actions.Retire, restore = actions.Restore)
251251

252-
protocol = 'http'
253-
host = self.client.env['HTTP_HOST']
254-
tracker = self.client.env['TRACKER_NAME']
255-
self.base_path = '%s://%s/%s/rest' % (protocol, host, tracker)
252+
# note TRACKER_WEB ends in a /
253+
self.base_path = '%srest' % (self.db.config.TRACKER_WEB)
256254
self.data_path = self.base_path + '/data'
257255

258256
def props_from_args(self, cl, args, itemid=None):

0 commit comments

Comments
 (0)