Skip to content

Commit

Permalink
Rm debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
shanefontaine committed May 16, 2024
1 parent 6e4db68 commit ba6789a
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,18 @@ func (s *Server) Start() error {

// Handler ...
func (s *Server) Handler(w http.ResponseWriter, r *http.Request) {
fmt.Printf("Received %s request\n", s.method)
fmt.Printf("Path: %s\n", s.path)
b, err := ioutil.ReadAll(r.Body)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprintf(w, err.Error())
return
}

fmt.Printf("Path: %s\n", s.secret)
if s.secret != "" {
headerSig := r.Header.Get("X-Hub-Signature-256")
sig := hmacSig(s.secret, b)
expectedSig := fmt.Sprintf("sha256=%x", sig)
if headerSig != expectedSig {
fmt.Printf("headerSig: %s\n", headerSig)
fmt.Printf("expectedSig: %s\n", expectedSig)
w.WriteHeader(http.StatusUnauthorized)
fmt.Fprintf(w, http.StatusText(http.StatusUnauthorized))
return
Expand Down

0 comments on commit ba6789a

Please sign in to comment.