diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 11 | 
1 files changed, 6 insertions, 5 deletions
| @@ -15,18 +15,19 @@ import ( | |||
| 15 | "fagott.pw/grilist/modules/tags" | 15 | "fagott.pw/grilist/modules/tags" | 
| 16 | "fagott.pw/grilist/modules/user" | 16 | "fagott.pw/grilist/modules/user" | 
| 17 | 17 | ||
| 18 | "strings" | ||
| 19 | |||
| 18 | "github.com/julienschmidt/httprouter" | 20 | "github.com/julienschmidt/httprouter" | 
| 19 | _ "github.com/lib/pq" | 21 | _ "github.com/lib/pq" | 
| 20 | "strings" | ||
| 21 | ) | 22 | ) | 
| 22 | 23 | ||
| 23 | var app *grilist.Grilist | 24 | var app *grilist.Grilist | 
| 24 | 25 | ||
| 25 | func index(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { | 26 | func index(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { | 
| 26 | if strings.Index(r.Referer(), "127.0.0.1") != -1 { | 27 | if strings.Index(r.Referer(), "127.0.0.1") != -1 { | 
| 27 | w.WriteHeader(200) | 28 | w.WriteHeader(200) | 
| 28 | return | 29 | return | 
| 29 | } | 30 | } | 
| 30 | http.Redirect(w, r, "/dashboard", 301) | 31 | http.Redirect(w, r, "/dashboard", 301) | 
| 31 | } | 32 | } | 
| 32 | 33 | ||
