fix for #160: avoid repeating self links in collections response (#161)

Resolves #160 (tests to be fixed in additional commit minutes from now).
This commit is contained in:
Brad Hards
2019-06-03 21:09:25 +09:30
committed by Just van den Broecke
parent 9babfff9cf
commit 36d7b00f80
+14 -14
View File
@@ -310,20 +310,20 @@ class API(object):
fcm['collections'].append(collection)
fcm['links'].append({
'type': 'application/json',
'rel': 'self',
'title': 'This document as JSON',
'href': '{}/collections?f=json'.format(
self.config['server']['url'])
})
fcm['links'].append({
'type': 'text/html',
'rel': 'alternate',
'title': 'This document as HTML',
'href': '{}/collections?f=html'.format(
self.config['server']['url'])
})
fcm['links'].append({
'type': 'application/json',
'rel': 'self',
'title': 'This document as JSON',
'href': '{}/collections?f=json'.format(
self.config['server']['url'])
})
fcm['links'].append({
'type': 'text/html',
'rel': 'alternate',
'title': 'This document as HTML',
'href': '{}/collections?f=html'.format(
self.config['server']['url'])
})
if format_ == 'html': # render
fcm['links'][0]['rel'] = 'alternate'