Skip to content

Commit

Permalink
Ignoring empty actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Dynom committed Apr 26, 2017
1 parent f7a3268 commit c5aa25a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handlers/allowedactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func NewAllowedActions(l log.Logger, allowedActions []string) func(h http.Handle
return func(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
action := r.URL.Path[1:]
if _, exists := actions[action]; !exists {
if _, exists := actions[action]; action != "" && !exists {
l.Log("error", "action is not white-listed", "action", action, "allowed", strings.Join(allowedActions, ","))
http.Error(w, "Unregisterd action", http.StatusBadRequest)
return
Expand Down

0 comments on commit c5aa25a

Please sign in to comment.