File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,9 @@ func Listen() {
84
84
// Init handlers
85
85
lpp := strings .TrimRight (options .listenPathPrefix , "/" )
86
86
http .Handle ("/" , http .StripPrefix (options .listenPathPrefix , assets .PublicHandler ()))
87
+ if lpp != "" {
88
+ http .HandleFunc (fmt .Sprintf ("%s" , lpp ), RedirectHandler )
89
+ }
87
90
http .HandleFunc (fmt .Sprintf ("%s/search" , lpp ), SearchHandler )
88
91
http .HandleFunc (fmt .Sprintf ("%s/providers" , lpp ), ProvidersHandler )
89
92
@@ -131,6 +134,11 @@ func checkProvider(provider string) bool {
131
134
return false
132
135
}
133
136
137
+ // RedirectHandler
138
+ func RedirectHandler (w http.ResponseWriter , req * http.Request ) {
139
+ http .Redirect (w , req , options .listenPathPrefix , 301 )
140
+ }
141
+
134
142
// SearchHandler is the handler for the search route
135
143
func SearchHandler (w http.ResponseWriter , req * http.Request ) {
136
144
You can’t perform that action at this time.
0 commit comments