diff options
| author | Adnan Maolood <[email protected]> | 2021-04-21 12:48:16 -0400 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2021-04-21 12:48:27 -0400 |
| commit | 1170e007d464f5aa091264c0d22c05921bd39e77 (patch) | |
| tree | 5afbe485a1a086b2fcb927f357861540b1a1ebe1 | |
| parent | fs: Improve redirect behavior (diff) | |
| download | archived-go-gemini-1170e007d464f5aa091264c0d22c05921bd39e77.tar.xz archived-go-gemini-1170e007d464f5aa091264c0d22c05921bd39e77.zip | |
fs: Avoid equality check if lengths don't matchv0.2.1
| -rw-r--r-- | fs.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 } |