v0.0.238
This commit is contained in:
parent
f0881c9fd6
commit
0da098e9f9
@ -306,7 +306,7 @@ func (b *Builder) GinReq(ctx context.Context, g *gin.Context, req *http.Request)
|
|||||||
}
|
}
|
||||||
b.Str("gin.method", req.Method)
|
b.Str("gin.method", req.Method)
|
||||||
b.Str("gin.path", g.FullPath())
|
b.Str("gin.path", g.FullPath())
|
||||||
b.Str("gin.header", formatHeader(g.Request.Header))
|
b.Strs("gin.header", extractHeader(g.Request.Header))
|
||||||
if req.URL != nil {
|
if req.URL != nil {
|
||||||
b.Str("gin.url", req.URL.String())
|
b.Str("gin.url", req.URL.String())
|
||||||
}
|
}
|
||||||
@ -367,6 +367,20 @@ func formatHeader(header map[string][]string) string {
|
|||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func extractHeader(header map[string][]string) []string {
|
||||||
|
r := make([]string, 0, len(header))
|
||||||
|
for k, v := range header {
|
||||||
|
for _, hval := range v {
|
||||||
|
value := hval
|
||||||
|
value = strings.ReplaceAll(value, "\n", "\\n")
|
||||||
|
value = strings.ReplaceAll(value, "\r", "\\r")
|
||||||
|
value = strings.ReplaceAll(value, "\t", "\\t")
|
||||||
|
r = append(r, k+": "+value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Build creates a new error, ready to pass up the stack
|
// Build creates a new error, ready to pass up the stack
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package goext
|
package goext
|
||||||
|
|
||||||
const GoextVersion = "0.0.237"
|
const GoextVersion = "0.0.238"
|
||||||
|
|
||||||
const GoextVersionTimestamp = "2023-08-09T19:35:01+0200"
|
const GoextVersionTimestamp = "2023-08-09T19:51:41+0200"
|
||||||
|
Loading…
Reference in New Issue
Block a user