We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 8f31c2f commit 6c46a56Copy full SHA for 6c46a56
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