Merge pull request #143 from joshdekock/middleware-refactor-request-fix
http: stopped throwing error on invalid event
This commit is contained in:
commit
e9c481e500
2 changed files with 4 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
# This is the official list of Chihaya contributors, in alphabetical order.
|
||||
|
||||
Jimmy Zelinskie <jimmyzelinskie@gmail.com>
|
||||
Josh de Kock <josh@itanimul.li>
|
||||
Justin Li <jli@j-li.net>
|
||||
Leo Balduf <balduf@hm.edu>
|
||||
|
|
|
@ -23,7 +23,9 @@ func announceRequest(r *http.Request, cfg *httpConfig) (*chihaya.AnnounceRequest
|
|||
request := &chihaya.AnnounceRequest{Params: q}
|
||||
|
||||
eventStr, err := q.String("event")
|
||||
if err != nil {
|
||||
if err == query.ErrKeyNotFound {
|
||||
eventStr = ""
|
||||
} else if err != nil {
|
||||
return nil, tracker.ClientError("failed to parse parameter: event")
|
||||
}
|
||||
request.Event, err = event.New(eventStr)
|
||||
|
|
Loading…
Reference in a new issue