mirror of https://github.com/nealey/spongy
Stop running on error
This commit is contained in:
parent
550f0f3385
commit
40a3d1e755
Binary file not shown.
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue