Skip to content

Commit

Permalink
Redirect / to /admin/
Browse files Browse the repository at this point in the history
  • Loading branch information
dsamarin committed May 21, 2018
1 parent 922c1f2 commit ff4b367
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions shot.go
Expand Up @@ -148,6 +148,11 @@ func (a *ShotHandler) Access(name string, request *http.Request, redirectLevels
func (a *ShotHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// Get entry
name := strings.Trim(r.URL.Path, "/")
if name == "" {
http.Redirect(w, r, "/admin/", 308)
return
}

entry := a.Access(name, r, a.App.Config.RedirectLevels, true)

ip := RealRemoteIP(r)
Expand Down

0 comments on commit ff4b367

Please sign in to comment.