INNER CODE UNIT · Go

sanitizeLogString

iimeta/fastapi · internal/cmd/cmd.go:480

func sanitizeLogString(s string) string {
	replacer := strings.NewReplacer("\r\n", "\\n", "\r", "\\n", "\n", "\\n")
	return replacer.Replace(s)
}

func calcReceiveTime(r *ghttp.Request) {
	if gstr.Contains(r.Header.Get("Content-Type"), "multipart/") {
		r.GetMultipartForm()
	} else {
		_ = r.GetBody()
	}
	r.SetCtxVar(consts.RECEIVE_TIME_KEY, gtime.TimestampMilli()-r.EnterTime.TimestampMilli())
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…