mirror of
https://github.com/go-gitea/gitea
synced 2025-07-14 14:37:20 +00:00
Fixes a wrong 302 redirect to the login page, see https://github.com/go-gitea/gitea/issues/11989. Also made it so the reserved username list is extended with those known entries so we avoid code duplication.
This commit is contained in:
@ -30,12 +30,13 @@ type Options struct {
|
||||
Prefix string
|
||||
}
|
||||
|
||||
// List of known entries inside the `public` directory
|
||||
var knownEntries = []string{
|
||||
// KnownPublicEntries list all direct children in the `public` directory
|
||||
var KnownPublicEntries = []string{
|
||||
"css",
|
||||
"fomantic",
|
||||
"img",
|
||||
"js",
|
||||
"serviceworker.js",
|
||||
"vendor",
|
||||
}
|
||||
|
||||
@ -114,7 +115,7 @@ func (opts *Options) handle(ctx *macaron.Context, log *log.Logger, opt *Options)
|
||||
if len(parts) < 2 {
|
||||
return false
|
||||
}
|
||||
for _, entry := range knownEntries {
|
||||
for _, entry := range KnownPublicEntries {
|
||||
if entry == parts[1] {
|
||||
ctx.Resp.WriteHeader(404)
|
||||
return true
|
||||
|
Reference in New Issue
Block a user