Skip to content

Commit 516c140

Browse files
authored
Update modules/web/middleware/locale.go
1 parent b870ac1 commit 516c140

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/web/middleware/locale.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ func Locale(resp http.ResponseWriter, req *http.Request) translation.Locale {
1919
// 1. Check URL arguments.
2020
lang := req.URL.Query().Get("lang")
2121
changeLang := lang != ""
22+
// If the request is sent from language menu by AJAX, then it should only set the language but not run the real handler.
23+
// Otherwise the irrelevant code might be executed.
2224
skipHandler := req.URL.Query().Get("lang_skip_handler") != ""
2325

2426
// 2. Get language information from cookies.

0 commit comments

Comments
 (0)