Stop running on error

This commit is contained in:
Neale Pickett 2015-02-21 17:37:00 -07:00
parent 550f0f3385
commit 40a3d1e755
2 changed files with 2 additions and 0 deletions

Binary file not shown.

View File

@ -46,12 +46,14 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
cfg, err := ReadConfig(h.Dir)
if err != nil {
http.Error(w, err.Error(), 500)
return
}
// Validate authtok
authtok, err := cfg.Get("authtok")
if err != nil {
http.Error(w, err.Error(), 500)
return
}
if r.FormValue("auth") != authtok {
w.Header().Set("Content-Type", "text/plain")