fs: Avoid equality check if lengths don't match
This commit is contained in:
parent
c85759d777
commit
1170e007d4
2
fs.go
2
fs.go
@ -67,7 +67,7 @@ func (fsys fileServer) ServeGemini(ctx context.Context, w ResponseWriter, r *Req
|
|||||||
if target != "/" {
|
if target != "/" {
|
||||||
target += "/"
|
target += "/"
|
||||||
}
|
}
|
||||||
if r.URL.Path != target {
|
if len(r.URL.Path) != len(target) || r.URL.Path != target {
|
||||||
w.WriteHeader(StatusPermanentRedirect, target)
|
w.WriteHeader(StatusPermanentRedirect, target)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user