mirror of
https://git.sr.ht/~adnano/go-gemini
synced 2025-05-01 19:05:25 +02:00
fs: Avoid equality check if lengths don't match
This commit is contained in:
parent
fed90d2759
commit
5662c5a26c
2
fs.go
2
fs.go
@ -67,7 +67,7 @@ func (fsys fileServer) ServeGemini(ctx context.Context, w ResponseWriter, r *Req
|
||||
if target != "/" {
|
||||
target += "/"
|
||||
}
|
||||
if r.URL.Path != target {
|
||||
if len(r.URL.Path) != len(target) || r.URL.Path != target {
|
||||
w.WriteHeader(StatusPermanentRedirect, target)
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user