mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
web: Redirect base path prefix to prefix/ (#397)
Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
@@ -69,6 +69,9 @@ func NewServer(
|
|||||||
log.Info().Str("module", "web").Str("phase", "startup").Str("path", redirectBase).
|
log.Info().Str("module", "web").Str("phase", "startup").Str("path", redirectBase).
|
||||||
Msg("Base path configured")
|
Msg("Base path configured")
|
||||||
Router.Path("/").Handler(http.RedirectHandler(redirectBase, http.StatusFound))
|
Router.Path("/").Handler(http.RedirectHandler(redirectBase, http.StatusFound))
|
||||||
|
|
||||||
|
// Redirect prefix when missing trailing slash.
|
||||||
|
Router.Path(prefix("")).Handler(http.RedirectHandler(redirectBase, http.StatusFound))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dynamic paths.
|
// Dynamic paths.
|
||||||
|
|||||||
Reference in New Issue
Block a user