From 01abcad893970e706ac0d298437571f2477ccdc8 Mon Sep 17 00:00:00 2001 From: Josh de Kock Date: Wed, 30 Mar 2016 12:50:54 +0100 Subject: [PATCH] http/request: check if query.ErrKeyNotFound for event --- server/http/request.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/http/request.go b/server/http/request.go index 45f94be..a8ae9d5 100644 --- a/server/http/request.go +++ b/server/http/request.go @@ -23,8 +23,10 @@ func announceRequest(r *http.Request, cfg *httpConfig) (*chihaya.AnnounceRequest request := &chihaya.AnnounceRequest{Params: q} eventStr, err := q.String("event") - if err != nil { - eventStr = "none" + if err == query.ErrKeyNotFound { + eventStr = "" + } else if err != nil { + return nil, tracker.ClientError("failed to parse parameter: event") } request.Event, err = event.New(eventStr) if err != nil {