diff --git a/pycsw/stac/api.py b/pycsw/stac/api.py index 06ae09328..f650015ec 100644 --- a/pycsw/stac/api.py +++ b/pycsw/stac/api.py @@ -594,8 +594,8 @@ def items(self, headers_, json_post_data, args, collection='metadata:main'): links2 = [] for link in response2.get('links', []): - if json_post_data is not None: - LOGGER.debug('Adding link body') + if json_post_data: + LOGGER.debug('Adding link method and body') link['method'] = 'POST' link['body'] = json_post_data diff --git a/tests/functionaltests/suites/stac_api/test_stac_api_functional.py b/tests/functionaltests/suites/stac_api/test_stac_api_functional.py index 8a56d56df..1f4640928 100644 --- a/tests/functionaltests/suites/stac_api/test_stac_api_functional.py +++ b/tests/functionaltests/suites/stac_api/test_stac_api_functional.py @@ -171,6 +171,8 @@ def test_items(config): assert 'href' in link assert 'rel' in link assert 'metadata:main' not in link['href'] + assert 'method' not in link + assert 'body' not in link # test GET KVP requests content = json.loads(api.items({}, None, {'bbox': '-180,-90,180,90'})[2])