Skip to content

Commit fcd3938

Browse files
authored
OAProc: prevent redirects on callbacks (#2393)
1 parent b96765c commit fcd3938

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

pygeoapi/process/manager/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def __do_subscriber_request(self, url: str, data: dict = {}) -> None:
517517
LOGGER.error(f'{msg}: {url}')
518518
raise ProcessorExecuteError(msg)
519519

520-
response = requests.post(url, json=data)
520+
response = requests.post(url, json=data, allow_redirects=False)
521521
LOGGER.debug(
522522
f'Response: {response.status_code}'
523523
)

tests/api/test_processes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,12 @@ def test_execute_process(config, api_):
397397
rsp_headers, code, response = execute_process(api_, req, 'hello-world')
398398
assert code == HTTPStatus.OK
399399
post_mocker.assert_any_call(
400-
req_body_7['subscriber']['inProgressUri'], json={}
400+
req_body_7['subscriber']['inProgressUri'], json={},
401+
allow_redirects=False
401402
)
402403
post_mocker.assert_any_call(
403404
req_body_7['subscriber']['successUri'],
404-
json={'id': 'echo', 'value': 'Hello Test!'}
405+
json={'id': 'echo', 'value': 'Hello Test!'}, allow_redirects=False
405406
)
406407
assert post_mocker.call_count == 2
407408

0 commit comments

Comments
 (0)