We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a2b7cc1 commit 3a00a69Copy full SHA for 3a00a69
modules/context/context.go
@@ -1,4 +1,5 @@
1
// Copyright 2014 The Gogs Authors. All rights reserved.
2
+// Copyright 2020 The Gitea Authors. All rights reserved.
3
// Use of this source code is governed by a MIT-style
4
// license that can be found in the LICENSE file.
5
@@ -122,7 +123,7 @@ func (ctx *Context) RedirectToFirst(location ...string) {
122
123
}
124
125
u, err := url.Parse(loc)
- if err != nil || (u.Scheme != "" && !strings.HasPrefix(strings.ToLower(loc), strings.ToLower(setting.AppURL))) {
126
+ if err != nil || ((u.Scheme != "" || u.Host != "") && !strings.HasPrefix(strings.ToLower(loc), strings.ToLower(setting.AppURL))) {
127
continue
128
129
0 commit comments