Skip to content

Commit 7846404

Browse files
committed
fix(dev): POST;
- Do not rend Location redirect for POST methods.
1 parent cde1a74 commit 7846404

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ckanext/language_domains/plugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ def __call__(self, environ: Any, start_response: Any) -> Any:
9999
root_path.replace('/{{LANG}}', '')
100100
environ['REQUEST_URI'] = current_uri = root_path + current_uri[
101101
len(f'/{current_lang}'):]
102+
if environ['REQUEST_METHOD'] == 'POST':
103+
# NOTE: cannot re-POST data from Location header redirects
104+
continue
102105
extra_response_headers = [(
103106
'Location',
104107
f'{self.domain_scheme}://{correct_lang_domain}{current_uri}')]

0 commit comments

Comments
 (0)