Add logging to micropub endpoint

This commit is contained in:
Peter Stuifzand 2018-07-03 22:51:31 +02:00
parent b8c00a22d6
commit 854e5f5e25

View File

@ -4,6 +4,7 @@ import (
"crypto/sha1" "crypto/sha1"
"encoding/json" "encoding/json"
"fmt" "fmt"
"log"
"net/http" "net/http"
"github.com/garyburd/redigo/redis" "github.com/garyburd/redigo/redis"
@ -21,6 +22,11 @@ func (h *micropubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
conn := pool.Get() conn := pool.Get()
defer conn.Close() defer conn.Close()
r.ParseForm()
log.Printf("%s %s\n", r.Method, r.URL)
log.Println(r.URL.Query())
log.Println(r.PostForm)
if r.Method == http.MethodPost { if r.Method == http.MethodPost {
sourceID := r.URL.Query().Get("source_id") sourceID := r.URL.Query().Get("source_id")