Skip to content

Commit

Permalink
Fix #718
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanh committed Jan 11, 2025
1 parent 7bb6808 commit ac5fb9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/hook/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ func (r Rules) Evaluate(req *Request) (bool, error) {
return r.Match.Evaluate(req)
}

return false, nil
return true, nil
}

// AndRule will evaluate to true if and only if all of the ChildRules evaluate to true
Expand Down
8 changes: 4 additions & 4 deletions webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"io"
"log"
"net"
"net/http"
Expand Down Expand Up @@ -172,7 +172,7 @@ func main() {
}

if !*verbose {
log.SetOutput(ioutil.Discard)
log.SetOutput(io.Discard)
}

// Create pidfile
Expand Down Expand Up @@ -379,7 +379,7 @@ func hookHandler(w http.ResponseWriter, r *http.Request) {
isMultipart := strings.HasPrefix(req.ContentType, "multipart/form-data;")

if !isMultipart {
req.Body, err = ioutil.ReadAll(r.Body)
req.Body, err = io.ReadAll(r.Body)
if err != nil {
log.Printf("[%s] error reading the request body: %+v\n", req.ID, err)
}
Expand Down Expand Up @@ -608,7 +608,7 @@ func handleHook(h *hook.Hook, r *hook.Request) (string, error) {
}

for i := range files {
tmpfile, err := ioutil.TempFile(h.CommandWorkingDirectory, files[i].EnvName)
tmpfile, err := os.CreateTemp(h.CommandWorkingDirectory, files[i].EnvName)
if err != nil {
log.Printf("[%s] error creating temp file [%s]", r.ID, err)
continue
Expand Down

0 comments on commit ac5fb9e

Please sign in to comment.