Skip to content

Commit

Permalink
Make sure internal redirects are actually internal
Browse files Browse the repository at this point in the history
This fixes #32
  • Loading branch information
thijzert committed Jun 7, 2024
1 parent 6a46f01 commit 7ad8523
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/web-plumbing/redirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ func (s *Server) redirect(w http.ResponseWriter, r *http.Request, url string, st

if len(url) == 0 {
url = "."
} else if len(url) > 1 && url[:2] == "//" {
url = "."
} else if url[0] != '/' && url[0] != '.' {
url = "./" + url
}
Expand Down

0 comments on commit 7ad8523

Please sign in to comment.