Skip to content

Commit

Permalink
Print headers too
Browse files Browse the repository at this point in the history
  • Loading branch information
pcarranza committed Sep 19, 2018
1 parent 6628eb4 commit 96cc584
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ func main() {

args := parseArgs()

http.HandleFunc("/github", handleGithub)
http.HandleFunc("/", handle)

logrus.Infof("listening on %s", args.Address)
logrus.Fatal(http.ListenAndServe(args.Address, nil))
}

func handleGithub(w http.ResponseWriter, r *http.Request) {
func handle(w http.ResponseWriter, r *http.Request) {
// This requires registering the webhooks using json format and only receive
// pull request events

Expand All @@ -35,7 +35,7 @@ func handleGithub(w http.ResponseWriter, r *http.Request) {

w.WriteHeader(http.StatusAccepted)

logrus.Infof("received Webhook payload: %s", string(body))
logrus.Infof("received Webhook\nHeaders: %#v\nPayload: %s", r.Header, string(body))
}

func setupLogger() {
Expand Down

0 comments on commit 96cc584

Please sign in to comment.