Skip to content

Commit

Permalink
feat: improve request log
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Jan 15, 2021
1 parent 45b4383 commit 61ce2f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"

Expand Down Expand Up @@ -223,8 +224,11 @@ func DefaultBeforeFunc(ctx context.Context, req *http.Request) context.Context {
fmt.Printf("Read Request body with error: %s", err.Error())
return ctx
}
enEscapeUrl, err := url.QueryUnescape(string(body))
if err == nil {
fmt.Println(string(enEscapeUrl))
}
req.Body = ioutil.NopCloser(bytes.NewBuffer(body))
fmt.Println(string(body))
return ctx
}

Expand Down

0 comments on commit 61ce2f0

Please sign in to comment.