From 4de61d49ef193e6d64fa4cc1c4040ad7e5a11dbc Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 9 Nov 2022 15:40:26 +0800 Subject: [PATCH] Fix UI language switching bug (#21597) Backport #21597 Related: * https://github.com/go-gitea/gitea/pull/21596#issuecomment-1291450224 There was a bug when switching language by AJAX: the irrelevant POST requests were processed by the target page's handler. Now, use GET instead of POST. The GET requests should be harmless. Co-authored-by: delvh Co-authored-by: Jason Song Co-authored-by: Lunny Xiao --- web_src/js/features/common-global.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js index a3aebc024625c..b00b4aea9c075 100644 --- a/web_src/js/features/common-global.js +++ b/web_src/js/features/common-global.js @@ -37,7 +37,7 @@ export function initHeadNavbarContentToggle() { export function initFootLanguageMenu() { function linkLanguageAction() { const $this = $(this); - $.post($this.data('url')).always(() => { + $.get($this.data('url')).always(() => { window.location.reload(); }); }