mirror of
https://github.com/sot-tech/mochi.git
synced 2026-06-11 23:43:29 -07:00
Merge pull request #143 from joshdekock/middleware-refactor-request-fix
http: stopped throwing error on invalid event
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user