diff --git a/modules/webhook.go b/modules/webhook.go index acc4117..4a878ce 100644 --- a/modules/webhook.go +++ b/modules/webhook.go @@ -8,6 +8,7 @@ import ( "flag" "fmt" "net/http" + "os" "strings" "git.dnix.de/an/xlog" @@ -25,7 +26,12 @@ func init() { } func webhookRun() { - scanner := bufio.NewScanner(*webhookToken) + file, err := os.Open(*webhookToken) + if err != nil { + xlog.Fatal(err.Error()) + } + defer file.Close() + scanner := bufio.NewScanner(file) for scanner.Scan() { tok := strings.Split(scanner.Text(), " ") http.HandleFunc("/webhook/"+tok[0], webhookHandleHTTP)