Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robiball committed Dec 6, 2018
1 parent 10a2b5e commit 1ab4a0b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ func (h *SlackHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.Logf("Error parsing payload: %s", err)
}
// Loop through all our routes and attempt a match on the InteractionType / CallbackID pair
for _, rt := range h.Routes {
if string(payload.Type) == rt.InteractionType && payload.CallbackID == rt.CallbackID {
// Send the payload as context
serve(rt.Handler, payload)
return
if payload != nil {
for _, rt := range h.Routes {
if string(payload.Type) == rt.InteractionType && payload.CallbackID == rt.CallbackID {
// Send the payload as context
serve(rt.Handler, payload)
return
}
}
}
} else {
Expand Down

0 comments on commit 1ab4a0b

Please sign in to comment.